diff --git a/.github/classifier.yml b/.github/classifier.yml index f65e146e091..8d750ed3baa 100644 --- a/.github/classifier.yml +++ b/.github/classifier.yml @@ -207,7 +207,7 @@ quick-pick: [ chrmarti ], release-notes: [], remote: { - assignees: [ jrieken ], + assignees: [ ], assignLabel: false }, rename: [], diff --git a/.github/feature-requests.yml b/.github/feature-requests.yml new file mode 100644 index 00000000000..18055b84486 --- /dev/null +++ b/.github/feature-requests.yml @@ -0,0 +1,34 @@ +{ + typeLabel: { + name: 'feature-request' + }, + candidateMilestone: { + number: 107, + name: 'Backlog Candidates' + }, + approvedMilestone: { + number: 8, + name: 'Backlog' + }, + onLabeled: { + delay: 60, + perform: true + }, + onCandidateMilestoned: { + candidatesComment: "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!", + perform: true + }, + onMonitorUpvotes: { + upvoteThreshold: 20, + acceptanceComment: ":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!", + perform: true + }, + onMonitorDaysOnCandidateMilestone: { + daysOnMilestone: 60, + warningPeriod: 10, + numberOfCommentsToPreventAutomaticRejection: 20, + rejectionComment: ":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!", + warningComment: "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", + perform: true + } +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 6fa93e1c9c5..13c87d635f3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -162,9 +162,12 @@ "urlFilter": "*workbench.html*", "runtimeArgs": [ "--inspect=5875", - "--no-cached-data" + "--no-cached-data", ], - "webRoot": "${workspaceFolder}" + "webRoot": "${workspaceFolder}", + // Settings for js-debug: + "pauseForSourceMap": false, + "outFiles": ["${workspaceFolder}/out/**/*.js"], }, { "type": "node", @@ -228,7 +231,7 @@ "type": "node", "request": "launch", "name": "HTML Unit Tests", - "program": "${workspaceFolder}/extensions/html-language-features/server/node_modules/mocha/bin/_mocha", + "program": "${workspaceFolder}/extensions/html-language-features/server/test/index.js", "stopOnEntry": false, "cwd": "${workspaceFolder}/extensions/html-language-features/server", "outFiles": [ diff --git a/.vscode/searches/ts36031.code-search b/.vscode/searches/ts36031.code-search new file mode 100644 index 00000000000..fb6cf8a431d --- /dev/null +++ b/.vscode/searches/ts36031.code-search @@ -0,0 +1,10 @@ +# Query: \\w+\\?\\..+![(.[] +# Flags: RegExp +# ContextLines: 2 + +src/vs/base/browser/ui/tree/asyncDataTree.ts: + 270 } : undefined, + 271 isChecked: options.ariaProvider!.isChecked ? (e) => { + 272: return options.ariaProvider?.isChecked!(e.element as T); + 273 } : undefined + 274 }, diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 7a3dd5cf7b3..7bd723dcbff 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -7,31 +7,31 @@ This project incorporates components from the projects listed below. The origina 1. atom/language-clojure version 0.22.7 (https://github.com/atom/language-clojure) 2. atom/language-coffee-script version 0.49.3 (https://github.com/atom/language-coffee-script) -3. atom/language-java version 0.31.3 (https://github.com/atom/language-java) +3. atom/language-java version 0.31.4 (https://github.com/atom/language-java) 4. atom/language-sass version 0.62.1 (https://github.com/atom/language-sass) 5. atom/language-shellscript version 0.26.0 (https://github.com/atom/language-shellscript) 6. atom/language-xml version 0.35.2 (https://github.com/atom/language-xml) -7. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes) -8. daaain/Handlebars version 1.8.0 (https://github.com/daaain/Handlebars) -9. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle) -10. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped) -11. demyte/language-cshtml version 0.3.0 (https://github.com/demyte/language-cshtml) -12. Document Object Model version 4.0.0 (https://www.w3.org/DOM/) -13. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage) -14. expand-abbreviation version 0.5.8 (https://github.com/emmetio/expand-abbreviation) -15. fadeevab/make.tmbundle (https://github.com/fadeevab/make.tmbundle) -16. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift) -17. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/) -18. Ikuyadeu/vscode-R version 0.5.5 (https://github.com/Ikuyadeu/vscode-R) -19. insane version 2.6.2 (https://github.com/bevacqua/insane) -20. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site) -21. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar) -22. jeff-hykin/cpp-textmate-grammar version 1.12.11 (https://github.com/jeff-hykin/cpp-textmate-grammar) -23. jeff-hykin/cpp-textmate-grammar version 1.14.13 (https://github.com/jeff-hykin/cpp-textmate-grammar) -24. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) -25. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) -26. language-docker (https://github.com/moby/moby) -27. language-go version 0.44.3 (https://github.com/atom/language-go) +7. better-go-syntax version 1.0.0 (https://github.com/jeff-hykin/better-go-syntax/ ) +8. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes) +9. daaain/Handlebars version 1.8.0 (https://github.com/daaain/Handlebars) +10. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle) +11. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped) +12. demyte/language-cshtml version 0.3.0 (https://github.com/demyte/language-cshtml) +13. Document Object Model version 4.0.0 (https://www.w3.org/DOM/) +14. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage) +15. expand-abbreviation version 0.5.8 (https://github.com/emmetio/expand-abbreviation) +16. fadeevab/make.tmbundle (https://github.com/fadeevab/make.tmbundle) +17. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift) +18. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/) +19. Ikuyadeu/vscode-R version 0.5.5 (https://github.com/Ikuyadeu/vscode-R) +20. insane version 2.6.2 (https://github.com/bevacqua/insane) +21. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site) +22. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar) +23. jeff-hykin/cpp-textmate-grammar version 1.12.11 (https://github.com/jeff-hykin/cpp-textmate-grammar) +24. jeff-hykin/cpp-textmate-grammar version 1.14.15 (https://github.com/jeff-hykin/cpp-textmate-grammar) +25. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) +26. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) +27. language-docker (https://github.com/moby/moby) 28. language-less version 0.34.2 (https://github.com/atom/language-less) 29. language-php version 0.44.3 (https://github.com/atom/language-php) 30. language-rust version 0.4.12 (https://github.com/zargony/atom-language-rust) @@ -340,6 +340,32 @@ suitability for any purpose. ========================================= END OF atom/language-xml NOTICES AND INFORMATION +%% better-go-syntax NOTICES AND INFORMATION BEGIN HERE +========================================= +MIT License + +Copyright (c) 2019 Jeff Hykin + +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. +========================================= +END OF better-go-syntax NOTICES AND INFORMATION + %% Colorsublime-Themes NOTICES AND INFORMATION BEGIN HERE ========================================= Copyright (c) 2015 Colorsublime.com @@ -987,83 +1013,6 @@ Apache License ========================================= END OF language-docker NOTICES AND INFORMATION -%% language-go NOTICES AND INFORMATION BEGIN HERE -========================================= -The MIT License (MIT) - -Copyright (c) 2014 GitHub Inc. - -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. - - -This package was derived from a TextMate bundle located at -https://github.com/rsms/Go.tmbundle and distributed under the following -license, located in `LICENSE`: - -Copyright (c) 2009 Rasmus Andersson - -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. - - -The Go Template grammar was derived from GoSublime located at -https://github.com/DisposaBoy/GoSublime and distributed under the following -license, located in `LICENSE.md`: - -Copyright (c) 2012 The GoSublime Authors - -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. -========================================= -END OF language-go NOTICES AND INFORMATION - %% language-less NOTICES AND INFORMATION BEGIN HERE ========================================= The MIT License (MIT) @@ -1692,10 +1641,10 @@ Copyright (c) Microsoft Corporation All rights reserved. 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 (c) 2016 Sanjay Nagamangalam +Copyright (c) 2016 Microsoft 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. ------------------------------------------------ END OF LICENSE ------------------------------------------ +----------------------------------------------- END OF LICENSE ----------------------------------------- ========================================= END OF Microsoft/vscode-mssql NOTICES AND INFORMATION @@ -2858,4 +2807,4 @@ Apache License See the License for the specific language governing permissions and limitations under the License. ========================================= -END OF Web Background Synchronization NOTICES AND INFORMATION \ No newline at end of file +END OF Web Background Synchronization NOTICES AND INFORMATION diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e52afca6028..b2f9a13c2b7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,6 +13,6 @@ jobs: - job: macOS pool: - vmImage: macOS 10.13 + vmImage: macOS-latest steps: - - template: build/azure-pipelines/darwin/continuous-build-darwin.yml \ No newline at end of file + - template: build/azure-pipelines/darwin/continuous-build-darwin.yml diff --git a/build/azure-pipelines/linux/xvfb.init b/build/azure-pipelines/linux/xvfb.init index 4d77d253a26..2365c09f3a4 100644 --- a/build/azure-pipelines/linux/xvfb.init +++ b/build/azure-pipelines/linux/xvfb.init @@ -19,7 +19,7 @@ [ "${NETWORKING}" = "no" ] && exit 0 PROG="/usr/bin/Xvfb" -PROG_OPTIONS=":10 -ac" +PROG_OPTIONS=":10 -ac -screen 0 1024x768x24" PROG_OUTPUT="/tmp/Xvfb.out" case "$1" in @@ -50,4 +50,4 @@ case "$1" in exit 1 esac -exit $RETVAL \ No newline at end of file +exit $RETVAL diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index 2eedaf8dce5..a98b5f4f77e 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -102,7 +102,7 @@ jobs: - job: macOS condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_MACOS'], 'true')) pool: - vmImage: macOS 10.13 + vmImage: macOS-latest dependsOn: - Compile steps: diff --git a/build/builtInExtensions.json b/build/builtInExtensions.json index 57808f0f833..39e7a337ef2 100644 --- a/build/builtInExtensions.json +++ b/build/builtInExtensions.json @@ -16,7 +16,7 @@ }, { "name": "ms-vscode.node-debug2", - "version": "1.42.0", + "version": "1.42.1", "repo": "https://github.com/Microsoft/vscode-node-debug2", "metadata": { "id": "36d19e17-7569-4841-a001-947eb18602b2", @@ -31,7 +31,7 @@ }, { "name": "ms-vscode.references-view", - "version": "0.0.44", + "version": "0.0.47", "repo": "https://github.com/Microsoft/vscode-reference-view", "metadata": { "id": "dc489f46-520d-4556-ae85-1f9eab3c412d", @@ -43,5 +43,23 @@ }, "publisherDisplayName": "Microsoft" } + }, + { + "name": "ms-vscode.js-debug-nightly", + "version": "2020.1.36063", + "forQualities": [ + "insider" + ], + "repo": "https://github.com/Microsoft/vscode-js-debug", + "metadata": { + "id": "7acbb4ce-c85a-49d4-8d95-a8054406ae97", + "publisherId": { + "publisherId": "5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee", + "publisherName": "ms-vscode", + "displayName": "Microsoft", + "flags": "verified" + }, + "publisherDisplayName": "Microsoft" + } } ] diff --git a/build/builtin/browser-main.js b/build/builtin/browser-main.js index 60b30655c0c..a7618454656 100644 --- a/build/builtin/browser-main.js +++ b/build/builtin/browser-main.js @@ -10,6 +10,7 @@ const os = require('os'); const { remote } = require('electron'); const dialog = remote.dialog; +const productJsonPath = path.join(__dirname, '..', '..', 'product.json'); const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json'); const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json'); @@ -51,6 +52,7 @@ function render(el, state) { } const ul = document.createElement('ul'); + const { quality } = readJson(productJsonPath); const { builtin, control } = state; for (const ext of builtin) { @@ -61,6 +63,10 @@ function render(el, state) { const name = document.createElement('code'); name.textContent = ext.name; + if (quality && ext.forQualities && !ext.forQualities.includes(quality)) { + name.textContent += ` (only on ${ext.forQualities.join(', ')})`; + } + li.appendChild(name); const form = document.createElement('form'); @@ -123,4 +129,4 @@ function main() { render(el, { builtin, control }); } -window.onload = main; \ No newline at end of file +window.onload = main; diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index bc11c8b5034..b686d280189 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -353,6 +353,13 @@ gulp.task('editor-distro', ) ); +gulp.task('monacodts', task.define('monacodts', () => { + const result = monacoapi.execute(); + fs.writeFileSync(result.filePath, result.content); + fs.writeFileSync(path.join(root, 'src/vs/editor/common/standalone/standaloneEnums.ts'), result.enums); + return Promise.resolve(true); +})); + //#region monaco type checking function createTscCompileTask(watch) { diff --git a/build/lib/extensions.js b/build/lib/extensions.js index c4385655eb9..e45b0d4e35a 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -27,6 +27,7 @@ const util = require('./util'); const root = path.dirname(path.dirname(__dirname)); const commit = util.getVersion(root); const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`; +const product = require('../../product.json'); function fromLocal(extensionPath) { const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js'); const input = fs.existsSync(webpackFilename) @@ -184,8 +185,10 @@ const excludedExtensions = [ 'vscode-test-resolver', 'ms-vscode.node-debug', 'ms-vscode.node-debug2', + 'ms.vscode.js-debug-nightly' ]; -const builtInExtensions = require('../builtInExtensions.json'); +const builtInExtensions = require('../builtInExtensions.json') + .filter(({ forQualities }) => { var _a; return !product.quality || ((_a = forQualities === null || forQualities === void 0 ? void 0 : forQualities.includes) === null || _a === void 0 ? void 0 : _a.call(forQualities, product.quality)) !== false; }); function packageLocalExtensionsStream() { const localExtensionDescriptions = glob.sync('extensions/*/package.json') .map(manifestPath => { diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts index 05bc7094846..9c90cb60c47 100644 --- a/build/lib/extensions.ts +++ b/build/lib/extensions.ts @@ -27,6 +27,7 @@ const util = require('./util'); const root = path.dirname(path.dirname(__dirname)); const commit = util.getVersion(root); const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`; +const product = require('../../product.json'); function fromLocal(extensionPath: string): Stream { const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js'); @@ -219,16 +220,19 @@ const excludedExtensions = [ 'vscode-test-resolver', 'ms-vscode.node-debug', 'ms-vscode.node-debug2', + 'ms.vscode.js-debug-nightly' ]; interface IBuiltInExtension { name: string; version: string; repo: string; + forQualities?: ReadonlyArray; metadata: any; } -const builtInExtensions: IBuiltInExtension[] = require('../builtInExtensions.json'); +const builtInExtensions = (require('../builtInExtensions.json')) + .filter(({ forQualities }) => !product.quality || forQualities?.includes?.(product.quality) !== false); export function packageLocalExtensionsStream(): NodeJS.ReadWriteStream { const localExtensionDescriptions = (glob.sync('extensions/*/package.json')) diff --git a/build/lib/i18n.resources.json b/build/lib/i18n.resources.json index 378db9f4b4c..15ea7384f0e 100644 --- a/build/lib/i18n.resources.json +++ b/build/lib/i18n.resources.json @@ -30,6 +30,14 @@ "name": "vs/workbench/api/common", "project": "vscode-workbench" }, + { + "name": "vs/workbench/contrib/backup", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/contrib/bulkEdit", + "project": "vscode-workbench" + }, { "name": "vs/workbench/contrib/cli", "project": "vscode-workbench" @@ -313,6 +321,10 @@ { "name": "vs/workbench/services/userData", "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/userDataSync", + "project": "vscode-workbench" } ] } diff --git a/build/monaco/api.js b/build/monaco/api.js index a429cd66cde..0fbaf7335b7 100644 --- a/build/monaco/api.js +++ b/build/monaco/api.js @@ -9,7 +9,7 @@ const ts = require("typescript"); const path = require("path"); const fancyLog = require("fancy-log"); const ansiColors = require("ansi-colors"); -const dtsv = '2'; +const dtsv = '3'; const tsfmt = require('../../tsfmt.json'); const SRC = path.join(__dirname, '../../src'); exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe'); @@ -148,12 +148,44 @@ function getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, } }); } + else if (declaration.kind === ts.SyntaxKind.VariableStatement) { + const jsDoc = result.substr(0, declaration.getLeadingTriviaWidth(sourceFile)); + if (jsDoc.indexOf('@monacodtsreplace') >= 0) { + const jsDocLines = jsDoc.split(/\r\n|\r|\n/); + let directives = []; + for (const jsDocLine of jsDocLines) { + const m = jsDocLine.match(/^\s*\* \/([^/]+)\/([^/]+)\/$/); + if (m) { + directives.push([new RegExp(m[1], 'g'), m[2]]); + } + } + // remove the jsdoc + result = result.substr(jsDoc.length); + if (directives.length > 0) { + // apply replace directives + const replacer = createReplacerFromDirectives(directives); + result = replacer(result); + } + } + } result = result.replace(/export default /g, 'export '); result = result.replace(/export declare /g, 'export '); result = result.replace(/declare /g, ''); + let lines = result.split(/\r\n|\r|\n/); + for (let i = 0; i < lines.length; i++) { + if (/\s*\*/.test(lines[i])) { + // very likely a comment + continue; + } + lines[i] = lines[i].replace(/"/g, '\''); + } + result = lines.join('\n'); if (declaration.kind === ts.SyntaxKind.EnumDeclaration) { result = result.replace(/const enum/, 'enum'); - enums.push(result); + enums.push({ + enumName: declaration.name.getText(sourceFile), + text: result + }); } return result; } @@ -277,6 +309,14 @@ function format(text, endl) { return result; } } +function createReplacerFromDirectives(directives) { + return (str) => { + for (let i = 0; i < directives.length; i++) { + str = str.replace(directives[i][0], directives[i][1]); + } + return str; + }; +} function createReplacer(data) { data = data || ''; let rawDirectives = data.split(';'); @@ -292,12 +332,7 @@ function createReplacer(data) { findStr = '\\b' + findStr + '\\b'; directives.push([new RegExp(findStr, 'g'), replaceStr]); }); - return (str) => { - for (let i = 0; i < directives.length; i++) { - str = str.replace(directives[i][0], directives[i][1]); - } - return str; - }; + return createReplacerFromDirectives(directives); } function generateDeclarationFile(recipe, sourceFileGetter) { const endl = /\r\n/.test(recipe) ? '\r\n' : '\n'; @@ -415,6 +450,15 @@ function generateDeclarationFile(recipe, sourceFileGetter) { resultTxt = resultTxt.split(/\r\n|\n|\r/).join(endl); resultTxt = format(resultTxt, endl); resultTxt = resultTxt.split(/\r\n|\n|\r/).join(endl); + enums.sort((e1, e2) => { + if (e1.enumName < e2.enumName) { + return -1; + } + if (e1.enumName > e2.enumName) { + return 1; + } + return 0; + }); let resultEnums = [ '/*---------------------------------------------------------------------------------------------', ' * Copyright (c) Microsoft Corporation. All rights reserved.', @@ -423,7 +467,7 @@ function generateDeclarationFile(recipe, sourceFileGetter) { '', '// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.', '' - ].concat(enums).join(endl); + ].concat(enums.map(e => e.text)).join(endl); resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl); resultEnums = format(resultEnums, endl); resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl); diff --git a/build/monaco/api.ts b/build/monaco/api.ts index ae058292344..511768ee64b 100644 --- a/build/monaco/api.ts +++ b/build/monaco/api.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import * as fancyLog from 'fancy-log'; import * as ansiColors from 'ansi-colors'; -const dtsv = '2'; +const dtsv = '3'; const tsfmt = require('../../tsfmt.json'); @@ -138,7 +138,7 @@ function isDefaultExport(declaration: ts.InterfaceDeclaration | ts.ClassDeclarat ); } -function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declaration: TSTopLevelDeclare, importName: string, usage: string[], enums: string[]): string { +function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declaration: TSTopLevelDeclare, importName: string, usage: string[], enums: IEnumEntry[]): string { let result = getNodeText(sourceFile, declaration); if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) { let interfaceDeclaration = declaration; @@ -177,14 +177,45 @@ function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declarati // life.. } }); + } else if (declaration.kind === ts.SyntaxKind.VariableStatement) { + const jsDoc = result.substr(0, declaration.getLeadingTriviaWidth(sourceFile)); + if (jsDoc.indexOf('@monacodtsreplace') >= 0) { + const jsDocLines = jsDoc.split(/\r\n|\r|\n/); + let directives: [RegExp, string][] = []; + for (const jsDocLine of jsDocLines) { + const m = jsDocLine.match(/^\s*\* \/([^/]+)\/([^/]+)\/$/); + if (m) { + directives.push([new RegExp(m[1], 'g'), m[2]]); + } + } + // remove the jsdoc + result = result.substr(jsDoc.length); + if (directives.length > 0) { + // apply replace directives + const replacer = createReplacerFromDirectives(directives); + result = replacer(result); + } + } } result = result.replace(/export default /g, 'export '); result = result.replace(/export declare /g, 'export '); result = result.replace(/declare /g, ''); + let lines = result.split(/\r\n|\r|\n/); + for (let i = 0; i < lines.length; i++) { + if (/\s*\*/.test(lines[i])) { + // very likely a comment + continue; + } + lines[i] = lines[i].replace(/"/g, '\''); + } + result = lines.join('\n'); if (declaration.kind === ts.SyntaxKind.EnumDeclaration) { result = result.replace(/const enum/, 'enum'); - enums.push(result); + enums.push({ + enumName: declaration.name.getText(sourceFile), + text: result + }); } return result; @@ -324,6 +355,15 @@ function format(text: string, endl: string): string { } } +function createReplacerFromDirectives(directives: [RegExp, string][]): (str: string) => string { + return (str: string) => { + for (let i = 0; i < directives.length; i++) { + str = str.replace(directives[i][0], directives[i][1]); + } + return str; + }; +} + function createReplacer(data: string): (str: string) => string { data = data || ''; let rawDirectives = data.split(';'); @@ -341,12 +381,7 @@ function createReplacer(data: string): (str: string) => string { directives.push([new RegExp(findStr, 'g'), replaceStr]); }); - return (str: string) => { - for (let i = 0; i < directives.length; i++) { - str = str.replace(directives[i][0], directives[i][1]); - } - return str; - }; + return createReplacerFromDirectives(directives); } interface ITempResult { @@ -355,6 +390,11 @@ interface ITempResult { enums: string; } +interface IEnumEntry { + enumName: string; + text: string; +} + function generateDeclarationFile(recipe: string, sourceFileGetter: SourceFileGetter): ITempResult | null { const endl = /\r\n/.test(recipe) ? '\r\n' : '\n'; @@ -376,7 +416,7 @@ function generateDeclarationFile(recipe: string, sourceFileGetter: SourceFileGet return importName; }; - let enums: string[] = []; + let enums: IEnumEntry[] = []; let version: string | null = null; lines.forEach(line => { @@ -492,6 +532,16 @@ function generateDeclarationFile(recipe: string, sourceFileGetter: SourceFileGet resultTxt = format(resultTxt, endl); resultTxt = resultTxt.split(/\r\n|\n|\r/).join(endl); + enums.sort((e1, e2) => { + if (e1.enumName < e2.enumName) { + return -1; + } + if (e1.enumName > e2.enumName) { + return 1; + } + return 0; + }); + let resultEnums = [ '/*---------------------------------------------------------------------------------------------', ' * Copyright (c) Microsoft Corporation. All rights reserved.', @@ -500,7 +550,7 @@ function generateDeclarationFile(recipe: string, sourceFileGetter: SourceFileGet '', '// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.', '' - ].concat(enums).join(endl); + ].concat(enums.map(e => e.text)).join(endl); resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl); resultEnums = format(resultEnums, endl); resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl); diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index f16ed378bd5..fdcdf533406 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -62,6 +62,7 @@ export interface ICommandHandler { #includeAll(vs/editor/common/editorCommon;editorOptions.=>): IScrollEvent #includeAll(vs/editor/common/model/textModelEvents): #includeAll(vs/editor/common/controller/cursorEvents): +#include(vs/platform/accessibility/common/accessibility): AccessibilitySupport #includeAll(vs/editor/common/config/editorOptions): #includeAll(vs/editor/browser/editorBrowser;editorCommon.=>;editorOptions.=>): #include(vs/editor/common/config/fontInfo): FontInfo, BareFontInfo @@ -87,4 +88,4 @@ declare namespace monaco.worker { } -//dtsv=2 +//dtsv=3 diff --git a/build/package.json b/build/package.json index 33c254aafe1..77cfdaf721b 100644 --- a/build/package.json +++ b/build/package.json @@ -43,7 +43,7 @@ "minimist": "^1.2.0", "request": "^2.85.0", "terser": "4.3.8", - "typescript": "^3.8.0-dev.20200108", + "typescript": " 3.8.0-beta", "vsce": "1.48.0", "vscode-telemetry-extractor": "^1.5.4", "xml2js": "^0.4.17" diff --git a/build/win32/code.iss b/build/win32/code.iss index 5c995f26636..15293a0c5cf 100644 --- a/build/win32/code.iss +++ b/build/win32/code.iss @@ -970,10 +970,10 @@ Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\*\shell\{#RegValueNam Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\directory\shell\{#RegValueName}"; ValueType: expandsz; ValueName: ""; ValueData: "{cm:OpenWithCodeContextMenu,{#ShellNameShort}}"; Tasks: addcontextmenufolders; Flags: uninsdeletekey Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\directory\shell\{#RegValueName}"; ValueType: expandsz; ValueName: "Icon"; ValueData: "{app}\{#ExeBasename}.exe"; Tasks: addcontextmenufolders Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\directory\shell\{#RegValueName}\command"; ValueType: expandsz; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%V"""; Tasks: addcontextmenufolders -Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\directory\background\shell\{#RegValueName}"; ValueType: expandsz; ValueName: ""; ValueData: "Open w&ith {#ShellNameShort}"; Tasks: addcontextmenufolders; Flags: uninsdeletekey +Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\directory\background\shell\{#RegValueName}"; ValueType: expandsz; ValueName: ""; ValueData: "{cm:OpenWithCodeContextMenu,{#ShellNameShort}}"; Tasks: addcontextmenufolders; Flags: uninsdeletekey Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\directory\background\shell\{#RegValueName}"; ValueType: expandsz; ValueName: "Icon"; ValueData: "{app}\{#ExeBasename}.exe"; Tasks: addcontextmenufolders Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\directory\background\shell\{#RegValueName}\command"; ValueType: expandsz; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%V"""; Tasks: addcontextmenufolders -Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\Drive\shell\{#RegValueName}"; ValueType: expandsz; ValueName: ""; ValueData: "Open w&ith {#ShellNameShort}"; Tasks: addcontextmenufolders; Flags: uninsdeletekey +Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\Drive\shell\{#RegValueName}"; ValueType: expandsz; ValueName: ""; ValueData: "{cm:OpenWithCodeContextMenu,{#ShellNameShort}}"; Tasks: addcontextmenufolders; Flags: uninsdeletekey Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\Drive\shell\{#RegValueName}"; ValueType: expandsz; ValueName: "Icon"; ValueData: "{app}\{#ExeBasename}.exe"; Tasks: addcontextmenufolders Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\Drive\shell\{#RegValueName}\command"; ValueType: expandsz; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%V"""; Tasks: addcontextmenufolders diff --git a/build/yarn.lock b/build/yarn.lock index 38c1cbec7d9..6b7c3ea0068 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -2453,16 +2453,16 @@ typed-rest-client@^0.9.0: tunnel "0.0.4" underscore "1.8.3" +"typescript@ 3.8.0-beta": + version "3.8.0-beta" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.0-beta.tgz#acdcaf9f24c7e20b1ff0a6329d1e8d63691e2e13" + integrity sha512-mQEmQUJg0CQBhf/GSVnGscKv/jrKsrLxE01AhdjYmBNoXX2Iah3i38ufxXByXacK6Fc5Nr9oMz7MjpjgddiknA== + typescript@^3.0.1: version "3.5.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== -typescript@^3.8.0-dev.20200108: - version "3.8.0-dev.20200108" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.0-dev.20200108.tgz#ca3a4d950cd19112d80758be779fb07d577e49bc" - integrity sha512-SD3VEYUUrDGc0djorpi0zVdmVwmvuaSHta18WP3sS9X0HC7eA4izdjj07pVUc99IBpBw55ljUATm5vkNdvxX6w== - typical@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" diff --git a/extensions/bat/language-configuration.json b/extensions/bat/language-configuration.json index e4639541142..17bc92f6a91 100644 --- a/extensions/bat/language-configuration.json +++ b/extensions/bat/language-configuration.json @@ -17,6 +17,7 @@ ["{", "}"], ["[", "]"], ["(", ")"], + ["%", "%"], ["\"", "\""] ], "folding": { diff --git a/extensions/clojure/test/colorize-results/test_clj.json b/extensions/clojure/test/colorize-results/test_clj.json index b7dd17d91e8..64b91983a10 100644 --- a/extensions/clojure/test/colorize-results/test_clj.json +++ b/extensions/clojure/test/colorize-results/test_clj.json @@ -202,9 +202,9 @@ "t": "source.clojure meta.expression.clojure meta.definition.global.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -235,9 +235,9 @@ "t": "source.clojure meta.vector.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -257,9 +257,9 @@ "t": "source.clojure meta.vector.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -279,9 +279,9 @@ "t": "source.clojure meta.vector.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -345,9 +345,9 @@ "t": "source.clojure meta.vector.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -466,9 +466,9 @@ "t": "source.clojure meta.map.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -510,9 +510,9 @@ "t": "source.clojure meta.map.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -620,9 +620,9 @@ "t": "source.clojure meta.quoted-expression.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -642,9 +642,9 @@ "t": "source.clojure meta.quoted-expression.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -664,9 +664,9 @@ "t": "source.clojure meta.quoted-expression.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1368,9 +1368,9 @@ "t": "source.clojure meta.quoted-expression.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1390,9 +1390,9 @@ "t": "source.clojure meta.quoted-expression.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1412,9 +1412,9 @@ "t": "source.clojure meta.quoted-expression.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1522,9 +1522,9 @@ "t": "source.clojure meta.expression.clojure meta.vector.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1566,9 +1566,9 @@ "t": "source.clojure meta.expression.clojure meta.vector.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1610,9 +1610,9 @@ "t": "source.clojure meta.expression.clojure meta.vector.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2567,9 +2567,9 @@ "t": "source.clojure meta.expression.clojure meta.definition.global.clojure meta.map.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2611,9 +2611,9 @@ "t": "source.clojure meta.expression.clojure meta.definition.global.clojure meta.map.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2721,9 +2721,9 @@ "t": "source.clojure meta.expression.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3007,9 +3007,9 @@ "t": "source.clojure meta.expression.clojure meta.definition.global.clojure meta.expression.clojure meta.map.clojure constant.numeric.long.clojure", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3321,4 +3321,4 @@ "hc_black": "comment: #7CA668" } } -] \ No newline at end of file +] diff --git a/extensions/coffeescript/test/colorize-results/test-regex_coffee.json b/extensions/coffeescript/test/colorize-results/test-regex_coffee.json index 9daab0d5533..15f4b3cd384 100644 --- a/extensions/coffeescript/test/colorize-results/test-regex_coffee.json +++ b/extensions/coffeescript/test/colorize-results/test-regex_coffee.json @@ -147,9 +147,9 @@ "t": "source.coffee constant.numeric.decimal.coffee", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -191,9 +191,9 @@ "t": "source.coffee constant.numeric.decimal.coffee", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -202,9 +202,9 @@ "t": "source.coffee constant.numeric.decimal.coffee", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -224,9 +224,9 @@ "t": "source.coffee constant.numeric.decimal.coffee", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -725,4 +725,4 @@ "hc_black": "string.regexp: #D16969" } } -] \ No newline at end of file +] diff --git a/extensions/coffeescript/test/colorize-results/test_coffee.json b/extensions/coffeescript/test/colorize-results/test_coffee.json index d3de07d3f82..7c72176431d 100644 --- a/extensions/coffeescript/test/colorize-results/test_coffee.json +++ b/extensions/coffeescript/test/colorize-results/test_coffee.json @@ -1016,9 +1016,9 @@ "t": "source.coffee constant.numeric.decimal.coffee", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1038,9 +1038,9 @@ "t": "source.coffee constant.numeric.decimal.coffee", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1605,4 +1605,4 @@ "hc_black": "string.regexp: #D16969" } } -] \ No newline at end of file +] diff --git a/extensions/configuration-editing/schemas/attachContainer.schema.json b/extensions/configuration-editing/schemas/attachContainer.schema.json index cebd0f2bc3e..58e59d72ee0 100644 --- a/extensions/configuration-editing/schemas/attachContainer.schema.json +++ b/extensions/configuration-editing/schemas/attachContainer.schema.json @@ -40,7 +40,9 @@ "type": "array", "description": "An array of extensions that should be installed into the container.", "items": { - "type": "string" + "type": "string", + "pattern": "^([a-z0-9A-Z][a-z0-9\\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\\-A-Z]*)$", + "errorMessage": "Expected format '${publisher}.${name}'. Example: 'vscode.csharp'." } } } diff --git a/extensions/configuration-editing/schemas/devContainer.schema.json b/extensions/configuration-editing/schemas/devContainer.schema.json index aed58455d01..292fe629937 100644 --- a/extensions/configuration-editing/schemas/devContainer.schema.json +++ b/extensions/configuration-editing/schemas/devContainer.schema.json @@ -15,13 +15,22 @@ "type": "array", "description": "An array of extensions that should be installed into the container.", "items": { - "type": "string" + "type": "string", + "pattern": "^([a-z0-9A-Z][a-z0-9\\-A-Z]*)\\.([a-z0-9A-Z][a-z0-9\\-A-Z]*)$", + "errorMessage": "Expected format '${publisher}.${name}'. Example: 'vscode.csharp'." } }, "settings": { "$ref": "vscode://schemas/settings/machine", "description": "Machine specific settings that should be copied into the container." }, + "forwardPorts": { + "type": "array", + "description": "Ports that are forwarded from the container to the local machine.", + "items": { + "type": "integer" + } + }, "remoteEnv": { "type": "object", "additionalProperties": { diff --git a/extensions/cpp/test/colorize-results/test-80644_cpp.json b/extensions/cpp/test/colorize-results/test-80644_cpp.json index 580591726a4..069f31ee72b 100644 --- a/extensions/cpp/test/colorize-results/test-80644_cpp.json +++ b/extensions/cpp/test/colorize-results/test-80644_cpp.json @@ -378,9 +378,9 @@ "t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp meta.parameter.initialization.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -477,9 +477,9 @@ "t": "source.cpp meta.function.definition.special.constructor.cpp meta.head.function.definition.special.constructor.cpp meta.parameter.initialization.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -527,4 +527,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/cpp/test/colorize-results/test_c.json b/extensions/cpp/test/colorize-results/test_c.json index 74be734c5ca..30fd5393c47 100644 --- a/extensions/cpp/test/colorize-results/test_c.json +++ b/extensions/cpp/test/colorize-results/test_c.json @@ -851,9 +851,9 @@ "t": "source.c meta.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -983,9 +983,9 @@ "t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1181,9 +1181,9 @@ "t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1390,9 +1390,9 @@ "t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1720,9 +1720,9 @@ "t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1863,9 +1863,9 @@ "t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2226,9 +2226,9 @@ "t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2391,9 +2391,9 @@ "t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2765,9 +2765,9 @@ "t": "source.c meta.block.c constant.numeric.decimal.c", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2793,4 +2793,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/cpp/test/colorize-results/test_cc.json b/extensions/cpp/test/colorize-results/test_cc.json index 30c22384617..324b231bb1b 100644 --- a/extensions/cpp/test/colorize-results/test_cc.json +++ b/extensions/cpp/test/colorize-results/test_cc.json @@ -268,9 +268,9 @@ "t": "source.cpp meta.parens.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1979,4 +1979,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/cpp/test/colorize-results/test_cpp.json b/extensions/cpp/test/colorize-results/test_cpp.json index 4806798686a..108895f8f65 100644 --- a/extensions/cpp/test/colorize-results/test_cpp.json +++ b/extensions/cpp/test/colorize-results/test_cpp.json @@ -1390,9 +1390,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1401,9 +1401,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.point.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1412,9 +1412,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1423,9 +1423,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.other.unit.user-defined.cpp", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1599,9 +1599,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1632,9 +1632,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1753,9 +1753,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1775,9 +1775,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2149,9 +2149,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2248,9 +2248,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2402,9 +2402,9 @@ "t": "source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2430,4 +2430,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/csharp/test/colorize-results/test_cs.json b/extensions/csharp/test/colorize-results/test_cs.json index dbbe61ef3c6..5893af16e9d 100644 --- a/extensions/csharp/test/colorize-results/test_cs.json +++ b/extensions/csharp/test/colorize-results/test_cs.json @@ -444,9 +444,9 @@ "t": "source.cs constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -477,9 +477,9 @@ "t": "source.cs constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -510,9 +510,9 @@ "t": "source.cs constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -543,9 +543,9 @@ "t": "source.cs constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -576,9 +576,9 @@ "t": "source.cs constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -719,9 +719,9 @@ "t": "source.cs constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1027,9 +1027,9 @@ "t": "source.cs constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1374,4 +1374,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/css-language-features/client/src/cssMain.ts b/extensions/css-language-features/client/src/cssMain.ts index 936176e9103..beabfc68cad 100644 --- a/extensions/css-language-features/client/src/cssMain.ts +++ b/extensions/css-language-features/client/src/cssMain.ts @@ -45,18 +45,28 @@ export function activate(context: ExtensionContext) { dataPaths }, middleware: { - // testing the replace / insert mode provideCompletionItem(document: TextDocument, position: Position, context: CompletionContext, token: CancellationToken, next: ProvideCompletionItemsSignature): ProviderResult { + // testing the replace / insert mode function updateRanges(item: CompletionItem) { const range = item.range; - if (range && range.end.isAfter(position) && range.start.isBeforeOrEqual(position)) { - item.range2 = { inserting: new Range(range.start, position), replacing: range }; - item.range = undefined; + if (range instanceof Range && range.end.isAfter(position) && range.start.isBeforeOrEqual(position)) { + item.range = { inserting: new Range(range.start, position), replacing: range }; + } } + function updateLabel(item: CompletionItem) { + if (item.kind === CompletionItemKind.Color) { + item.label2 = { + name: item.label, + type: (item.documentation as string) + }; + } + } + // testing the new completion function updateProposals(r: CompletionItem[] | CompletionList | null | undefined): CompletionItem[] | CompletionList | null | undefined { if (r) { (Array.isArray(r) ? r : r.items).forEach(updateRanges); + (Array.isArray(r) ? r : r.items).forEach(updateLabel); } return r; } diff --git a/extensions/css/test/colorize-results/test-variables_css.json b/extensions/css/test/colorize-results/test-variables_css.json index 218818607d4..6cb52170983 100644 --- a/extensions/css/test/colorize-results/test-variables_css.json +++ b/extensions/css/test/colorize-results/test-variables_css.json @@ -92,9 +92,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -103,9 +103,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -180,9 +180,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -378,9 +378,9 @@ "t": "source.css meta.property-list.css meta.property-value.css meta.function.calc.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -477,9 +477,9 @@ "t": "source.css meta.property-list.css meta.property-value.css meta.function.calc.css meta.function.variable.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -488,9 +488,9 @@ "t": "source.css meta.property-list.css meta.property-value.css meta.function.calc.css meta.function.variable.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -538,4 +538,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/css/test/colorize-results/test_css.json b/extensions/css/test/colorize-results/test_css.json index 224520e7f48..95fa9755044 100644 --- a/extensions/css/test/colorize-results/test_css.json +++ b/extensions/css/test/colorize-results/test_css.json @@ -675,9 +675,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -741,9 +741,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -851,9 +851,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -862,9 +862,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -983,9 +983,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1324,9 +1324,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1390,9 +1390,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2281,9 +2281,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2501,9 +2501,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2512,9 +2512,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2633,9 +2633,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2644,9 +2644,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2710,9 +2710,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4129,9 +4129,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4151,9 +4151,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4162,9 +4162,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4184,9 +4184,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4206,9 +4206,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4217,9 +4217,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4283,9 +4283,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4470,9 +4470,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4481,9 +4481,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4547,9 +4547,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4558,9 +4558,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4877,9 +4877,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4888,9 +4888,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5020,9 +5020,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5031,9 +5031,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5097,9 +5097,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5108,9 +5108,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5240,9 +5240,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5251,9 +5251,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5493,9 +5493,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5504,9 +5504,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5570,9 +5570,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5581,9 +5581,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5768,9 +5768,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5779,9 +5779,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5801,9 +5801,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5812,9 +5812,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5834,9 +5834,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5845,9 +5845,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5867,9 +5867,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5878,9 +5878,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5944,9 +5944,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5955,9 +5955,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -6186,9 +6186,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6197,9 +6197,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -6219,9 +6219,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6494,9 +6494,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6505,9 +6505,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -6527,9 +6527,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6538,9 +6538,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -6560,9 +6560,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6582,9 +6582,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6593,9 +6593,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -6714,9 +6714,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6725,9 +6725,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -6791,9 +6791,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6802,9 +6802,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7132,9 +7132,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7143,9 +7143,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7264,9 +7264,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7275,9 +7275,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7407,9 +7407,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7473,9 +7473,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7627,9 +7627,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7638,9 +7638,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7946,9 +7946,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7957,9 +7957,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -8023,9 +8023,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8034,9 +8034,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -8100,9 +8100,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8111,9 +8111,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -8892,9 +8892,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8903,9 +8903,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -8969,9 +8969,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9035,9 +9035,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9046,9 +9046,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -9112,9 +9112,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9123,9 +9123,9 @@ "t": "source.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -9151,4 +9151,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts index 9ec8edd9399..53c724570aa 100644 --- a/extensions/emmet/src/abbreviationActions.ts +++ b/extensions/emmet/src/abbreviationActions.ts @@ -94,8 +94,8 @@ function doWrapping(individualLines: boolean, args: any) { } else { const wholeFirstLine = editor.document.lineAt(rangeToReplace.start).text; const otherMatches = wholeFirstLine.match(/^(\s*)/); - const preceedingWhitespace = otherMatches ? otherMatches[1] : ''; - textToWrapInPreview = rangeToReplace.isSingleLine ? [textToReplace] : ['\n\t' + textToReplace.split('\n' + preceedingWhitespace).join('\n\t') + '\n']; + const precedingWhitespace = otherMatches ? otherMatches[1] : ''; + textToWrapInPreview = rangeToReplace.isSingleLine ? [textToReplace] : ['\n\t' + textToReplace.split('\n' + precedingWhitespace).join('\n\t') + '\n']; } textToWrapInPreview = textToWrapInPreview.map(e => e.replace(/(\$\d)/g, '\\$1')); diff --git a/extensions/fsharp/test/colorize-results/test_fs.json b/extensions/fsharp/test/colorize-results/test_fs.json index 2d1544d210e..9b68ea7507e 100644 --- a/extensions/fsharp/test/colorize-results/test_fs.json +++ b/extensions/fsharp/test/colorize-results/test_fs.json @@ -422,9 +422,9 @@ "t": "source.fsharp constant.numeric.integer.nativeint.fsharp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -928,9 +928,9 @@ "t": "source.fsharp constant.numeric.integer.nativeint.fsharp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1396,4 +1396,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/git/package.json b/extensions/git/package.json index 3e049ddd7e5..42025387d61 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -26,6 +26,11 @@ }, "contributes": { "commands": [ + { + "command": "git.setLogLevel", + "title": "%command.setLogLevel%", + "category": "Git" + }, { "command": "git.clone", "title": "%command.clone%", @@ -1194,7 +1199,7 @@ { "command": "git.openFile", "group": "navigation", - "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^gitfs$|^file$/" + "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/" }, { "command": "git.openChange", @@ -1204,44 +1209,44 @@ { "command": "git.stageSelectedRanges", "group": "2_git@1", - "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^gitfs$|^file$/" + "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/" }, { "command": "git.unstageSelectedRanges", "group": "2_git@2", - "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^gitfs$|^file$/" + "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/" }, { "command": "git.revertSelectedRanges", "group": "2_git@3", - "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^gitfs$|^file$/" + "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/" } ], "editor/context": [ { "command": "git.stageSelectedRanges", "group": "2_git@1", - "when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^gitfs$|^file$/" + "when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/" }, { "command": "git.unstageSelectedRanges", "group": "2_git@2", - "when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^gitfs$|^file$/" + "when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/" }, { "command": "git.revertSelectedRanges", "group": "2_git@3", - "when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^gitfs$|^file$/" + "when": "isInDiffRightEditor && config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/" } ], "scm/change/title": [ { "command": "git.stageChange", - "when": "originalResourceScheme == gitfs" + "when": "originalResourceScheme == git" }, { "command": "git.revertChange", - "when": "originalResourceScheme == gitfs" + "when": "originalResourceScheme == git" } ] }, diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 5c357b40eb0..f3d75519653 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -1,6 +1,7 @@ { "displayName": "Git", "description": "Git SCM Integration", + "command.setLogLevel": "Set Log Level...", "command.clone": "Clone", "command.init": "Initialize Repository", "command.openRepository": "Open Repository", diff --git a/extensions/git/src/api/api1.ts b/extensions/git/src/api/api1.ts index 8cee12e7726..3e389285312 100644 --- a/extensions/git/src/api/api1.ts +++ b/extensions/git/src/api/api1.ts @@ -239,5 +239,10 @@ export class ApiImpl implements API { return toGitUri(uri, ref); } + getRepository(uri: Uri): Repository | null { + const result = this._model.getRepository(uri); + return result ? new ApiRepository(result) : null; + } + constructor(private _model: Model) { } } diff --git a/extensions/git/src/api/git.d.ts b/extensions/git/src/api/git.d.ts index a6eb7ec3d9a..f614d8eec99 100644 --- a/extensions/git/src/api/git.d.ts +++ b/extensions/git/src/api/git.d.ts @@ -187,6 +187,7 @@ export interface API { readonly onDidCloseRepository: Event; toGitUri(uri: Uri, ref: string): Uri; + getRepository(uri: Uri): Repository | null; } export interface GitExtension { diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index a28161a823c..2414b16634f 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -16,6 +16,7 @@ import { Repository, Resource, ResourceGroupType } from './repository'; import { applyLineChanges, getModifiedRange, intersectDiffWithRange, invertLineChange, toLineRanges } from './staging'; import { fromGitUri, toGitUri, isGitUri } from './uri'; import { grep, isDescendant, pathEquals } from './util'; +import { Log, LogLevel } from './log'; const localize = nls.loadMessageBundle(); @@ -252,6 +253,36 @@ export class CommandCenter { }); } + @command('git.setLogLevel') + async setLogLevel(): Promise { + const createItem = (logLevel: LogLevel) => ({ + label: LogLevel[logLevel], + logLevel, + description: Log.logLevel === logLevel ? localize('current', "Current") : undefined + }); + + const items = [ + createItem(LogLevel.Trace), + createItem(LogLevel.Debug), + createItem(LogLevel.Info), + createItem(LogLevel.Warning), + createItem(LogLevel.Error), + createItem(LogLevel.Critical), + createItem(LogLevel.Off) + ]; + + const choice = await window.showQuickPick(items, { + placeHolder: localize('select log level', "Select log level") + }); + + if (!choice) { + return; + } + + Log.logLevel = choice.logLevel; + this.outputChannel.appendLine(localize('changed', "Log level changed to: {0}", LogLevel[Log.logLevel])); + } + @command('git.refresh', { repository: true }) async refresh(repository: Repository): Promise { await repository.status(); @@ -1580,7 +1611,7 @@ export class CommandCenter { await this._branch(repository, undefined, true); } - private async promptForBranchName(defaultName?: string): Promise { + private async promptForBranchName(defaultName?: string, initialValue?: string): Promise { const config = workspace.getConfiguration('git'); const branchWhitespaceChar = config.get('branchWhitespaceChar')!; const branchValidationRegex = config.get('branchValidationRegex')!; @@ -1591,6 +1622,7 @@ export class CommandCenter { const rawBranchName = defaultName || await window.showInputBox({ placeHolder: localize('branch name', "Branch name"), prompt: localize('provide branch name', "Please provide a branch name"), + value: initialValue, ignoreFocusOut: true, validateInput: (name: string) => { const validateName = new RegExp(branchValidationRegex); @@ -1668,7 +1700,8 @@ export class CommandCenter { @command('git.renameBranch', { repository: true }) async renameBranch(repository: Repository): Promise { - const branchName = await this.promptForBranchName(); + const currentBranchName = repository.HEAD && repository.HEAD.name; + const branchName = await this.promptForBranchName(undefined, currentBranchName); if (!branchName) { return; diff --git a/extensions/git/src/fileSystemProvider.ts b/extensions/git/src/fileSystemProvider.ts index 198f031309f..1168906dc30 100644 --- a/extensions/git/src/fileSystemProvider.ts +++ b/extensions/git/src/fileSystemProvider.ts @@ -8,6 +8,7 @@ import { debounce, throttle } from './decorators'; import { fromGitUri, toGitUri } from './uri'; import { Model, ModelChangeEvent, OriginalResourceChangeEvent } from './model'; import { filterEvent, eventToPromise, isDescendant, pathEquals, EmptyDisposable } from './util'; +import { Repository } from './repository'; interface CacheRow { uri: Uri; @@ -17,6 +18,21 @@ interface CacheRow { const THREE_MINUTES = 1000 * 60 * 3; const FIVE_MINUTES = 1000 * 60 * 5; +function sanitizeRef(ref: string, path: string, repository: Repository): string { + if (ref === '~') { + const fileUri = Uri.file(path); + const uriString = fileUri.toString(); + const [indexStatus] = repository.indexGroup.resourceStates.filter(r => r.resourceUri.toString() === uriString); + return indexStatus ? '' : 'HEAD'; + } + + if (/^~\d$/.test(ref)) { + return `:${ref[1]}`; + } + + return ref; +} + export class GitFileSystemProvider implements FileSystemProvider { private _onDidChangeFile = new EventEmitter(); @@ -31,9 +47,9 @@ export class GitFileSystemProvider implements FileSystemProvider { this.disposables.push( model.onDidChangeRepository(this.onDidChangeRepository, this), model.onDidChangeOriginalResource(this.onDidChangeOriginalResource, this), - workspace.registerFileSystemProvider('gitfs', this, { isReadonly: true, isCaseSensitive: true }), + workspace.registerFileSystemProvider('git', this, { isReadonly: true, isCaseSensitive: true }), workspace.registerResourceLabelFormatter({ - scheme: 'gitfs', + scheme: 'git', formatting: { label: '${path} (git)', separator: '/' @@ -116,15 +132,21 @@ export class GitFileSystemProvider implements FileSystemProvider { return EmptyDisposable; } - stat(uri: Uri): FileStat { - const { submoduleOf } = fromGitUri(uri); + async stat(uri: Uri): Promise { + const { submoduleOf, path, ref } = fromGitUri(uri); const repository = submoduleOf ? this.model.getRepository(submoduleOf) : this.model.getRepository(uri); - if (!repository) { throw FileSystemError.FileNotFound(); } - return { type: FileType.File, size: 0, mtime: this.mtime, ctime: 0 }; + let size = 0; + try { + const details = await repository.getObjectDetails(sanitizeRef(ref, path, repository), path); + size = details.size; + } catch { + // noop + } + return { type: FileType.File, size: size, mtime: this.mtime, ctime: 0 }; } readDirectory(): Thenable<[string, FileType][]> { @@ -136,7 +158,7 @@ export class GitFileSystemProvider implements FileSystemProvider { } async readFile(uri: Uri): Promise { - let { path, ref, submoduleOf } = fromGitUri(uri); + const { path, ref, submoduleOf } = fromGitUri(uri); if (submoduleOf) { const repository = this.model.getRepository(submoduleOf); @@ -165,17 +187,8 @@ export class GitFileSystemProvider implements FileSystemProvider { this.cache.set(uri.toString(), cacheValue); - if (ref === '~') { - const fileUri = Uri.file(path); - const uriString = fileUri.toString(); - const [indexStatus] = repository.indexGroup.resourceStates.filter(r => r.resourceUri.toString() === uriString); - ref = indexStatus ? '' : 'HEAD'; - } else if (/^~\d$/.test(ref)) { - ref = `:${ref[1]}`; - } - try { - return await repository.buffer(ref, path); + return await repository.buffer(sanitizeRef(ref, path, repository), path); } catch (err) { return new Uint8Array(0); } diff --git a/extensions/git/src/log.ts b/extensions/git/src/log.ts new file mode 100644 index 00000000000..487228e57a7 --- /dev/null +++ b/extensions/git/src/log.ts @@ -0,0 +1,50 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Event, EventEmitter } from 'vscode'; + +/** + * The severity level of a log message + */ +export enum LogLevel { + Trace = 1, + Debug = 2, + Info = 3, + Warning = 4, + Error = 5, + Critical = 6, + Off = 7 +} + +let _logLevel: LogLevel = LogLevel.Info; +const _onDidChangeLogLevel = new EventEmitter(); + +export const Log = { + /** + * Current logging level. + */ + get logLevel(): LogLevel { + return _logLevel; + }, + + /** + * Current logging level. + */ + set logLevel(logLevel: LogLevel) { + if (_logLevel === logLevel) { + return; + } + + _logLevel = logLevel; + _onDidChangeLogLevel.fire(logLevel); + }, + + /** + * An [event](#Event) that fires when the log level has changed. + */ + get onDidChangeLogLevel(): Event { + return _onDidChangeLogLevel.event; + } +}; diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts index 60ed1744434..bb664235103 100644 --- a/extensions/git/src/model.ts +++ b/extensions/git/src/model.ts @@ -392,7 +392,7 @@ export class Model { if (hint instanceof Uri) { let resourcePath: string; - if (hint.scheme === 'git' || hint.scheme === 'gitfs') { + if (hint.scheme === 'git') { resourcePath = fromGitUri(hint).path; } else { resourcePath = hint.fsPath; diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 47832f9e0f0..dd00637a502 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -5,7 +5,7 @@ import * as fs from 'fs'; import * as path from 'path'; -import { CancellationToken, Command, Disposable, env, Event, EventEmitter, LogLevel, Memento, OutputChannel, ProgressLocation, ProgressOptions, scm, SourceControl, SourceControlInputBox, SourceControlInputBoxValidation, SourceControlInputBoxValidationType, SourceControlResourceDecorations, SourceControlResourceGroup, SourceControlResourceState, ThemeColor, Uri, window, workspace, WorkspaceEdit, Decoration } from 'vscode'; +import { CancellationToken, Command, Disposable, Event, EventEmitter, Memento, OutputChannel, ProgressLocation, ProgressOptions, scm, SourceControl, SourceControlInputBox, SourceControlInputBoxValidation, SourceControlInputBoxValidationType, SourceControlResourceDecorations, SourceControlResourceGroup, SourceControlResourceState, ThemeColor, Uri, window, workspace, WorkspaceEdit, Decoration } from 'vscode'; import * as nls from 'vscode-nls'; import { Branch, Change, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status } from './api/git'; import { AutoFetcher } from './autofetch'; @@ -15,6 +15,7 @@ import { StatusBarCommands } from './statusbar'; import { toGitUri } from './uri'; import { anyEvent, combinedDisposable, debounceEvent, dispose, EmptyDisposable, eventToPromise, filterEvent, find, IDisposable, isDescendant, onceEvent } from './util'; import { IFileWatcher, watch } from './watch'; +import { Log, LogLevel } from './log'; const timeout = (millis: number) => new Promise(c => setTimeout(c, millis)); @@ -457,8 +458,8 @@ class FileEventLogger { private onDotGitFileChange: Event, private outputChannel: OutputChannel ) { - this.logLevelDisposable = env.onDidChangeLogLevel(this.onDidChangeLogLevel, this); - this.onDidChangeLogLevel(env.logLevel); + this.logLevelDisposable = Log.onDidChangeLogLevel(this.onDidChangeLogLevel, this); + this.onDidChangeLogLevel(Log.logLevel); } private onDidChangeLogLevel(level: LogLevel): void { @@ -519,7 +520,7 @@ class DotGitWatcher implements IFileWatcher { this.transientDisposables.push(upstreamWatcher); upstreamWatcher.event(this.emitter.fire, this.emitter, this.transientDisposables); } catch (err) { - if (env.logLevel <= LogLevel.Error) { + if (Log.logLevel <= LogLevel.Error) { this.outputChannel.appendLine(`Failed to watch ref '${upstreamPath}', is most likely packed.\n${err.stack || err}`); } } @@ -682,7 +683,7 @@ export class Repository implements Disposable { onDotGitFileChange = dotGitFileWatcher.event; this.disposables.push(dotGitFileWatcher); } catch (err) { - if (env.logLevel <= LogLevel.Error) { + if (Log.logLevel <= LogLevel.Error) { outputChannel.appendLine(`Failed to watch '${this.dotGit}', reverting to legacy API file watched. Some events might be lost.\n${err.stack || err}`); } diff --git a/extensions/git/src/uri.ts b/extensions/git/src/uri.ts index 3ef84a642f7..94e6b5e38ae 100644 --- a/extensions/git/src/uri.ts +++ b/extensions/git/src/uri.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { Uri } from 'vscode'; -import * as qs from 'querystring'; export interface GitUriParams { path: string; @@ -13,25 +12,11 @@ export interface GitUriParams { } export function isGitUri(uri: Uri): boolean { - return /^git(fs)?$/.test(uri.scheme); + return /^git$/.test(uri.scheme); } export function fromGitUri(uri: Uri): GitUriParams { - const result = qs.parse(uri.query) as any; - - if (!result) { - throw new Error('Invalid git URI: empty query'); - } - - if (typeof result.path !== 'string') { - throw new Error('Invalid git URI: missing path'); - } - - if (typeof result.ref !== 'string') { - throw new Error('Invalid git URI: missing ref'); - } - - return result; + return JSON.parse(uri.query); } export interface GitUriOptions { @@ -61,8 +46,8 @@ export function toGitUri(uri: Uri, ref: string, options: GitUriOptions = {}): Ur } return uri.with({ - scheme: 'gitfs', + scheme: 'git', path, - query: qs.stringify(params as any) + query: JSON.stringify(params) }); } diff --git a/extensions/git/test/colorize-results/COMMIT_EDITMSG.json b/extensions/git/test/colorize-results/COMMIT_EDITMSG.json index 508e3ee199c..0cb3e0690be 100644 --- a/extensions/git/test/colorize-results/COMMIT_EDITMSG.json +++ b/extensions/git/test/colorize-results/COMMIT_EDITMSG.json @@ -235,9 +235,9 @@ "t": "text.git-commit meta.scope.metadata.git-commit comment.line.number-sign.git-commit markup.inserted.git-commit", "r": { "dark_plus": "markup.inserted: #B5CEA8", - "light_plus": "markup.inserted: #09885A", + "light_plus": "markup.inserted: #098658", "dark_vs": "markup.inserted: #B5CEA8", - "light_vs": "markup.inserted: #09885A", + "light_vs": "markup.inserted: #098658", "hc_black": "markup.inserted: #B5CEA8" } }, @@ -252,4 +252,4 @@ "hc_black": "comment: #7CA668" } } -] \ No newline at end of file +] diff --git a/extensions/git/test/colorize-results/example_diff.json b/extensions/git/test/colorize-results/example_diff.json index 07ec9f737b5..85e08b9f135 100644 --- a/extensions/git/test/colorize-results/example_diff.json +++ b/extensions/git/test/colorize-results/example_diff.json @@ -147,9 +147,9 @@ "t": "source.diff markup.inserted.diff punctuation.definition.inserted.diff", "r": { "dark_plus": "markup.inserted: #B5CEA8", - "light_plus": "markup.inserted: #09885A", + "light_plus": "markup.inserted: #098658", "dark_vs": "markup.inserted: #B5CEA8", - "light_vs": "markup.inserted: #09885A", + "light_vs": "markup.inserted: #098658", "hc_black": "markup.inserted: #B5CEA8" } }, @@ -158,10 +158,10 @@ "t": "source.diff markup.inserted.diff", "r": { "dark_plus": "markup.inserted: #B5CEA8", - "light_plus": "markup.inserted: #09885A", + "light_plus": "markup.inserted: #098658", "dark_vs": "markup.inserted: #B5CEA8", - "light_vs": "markup.inserted: #09885A", + "light_vs": "markup.inserted: #098658", "hc_black": "markup.inserted: #B5CEA8" } } -] \ No newline at end of file +] diff --git a/extensions/git/test/colorize-results/git-rebase-todo.json b/extensions/git/test/colorize-results/git-rebase-todo.json index d21bab17094..38d82882964 100644 --- a/extensions/git/test/colorize-results/git-rebase-todo.json +++ b/extensions/git/test/colorize-results/git-rebase-todo.json @@ -26,9 +26,9 @@ "t": "text.git-rebase meta.commit-command.git-rebase constant.sha.git-rebase", "r": { "dark_plus": "constant.sha.git-rebase: #B5CEA8", - "light_plus": "constant.sha.git-rebase: #09885A", + "light_plus": "constant.sha.git-rebase: #098658", "dark_vs": "constant.sha.git-rebase: #B5CEA8", - "light_vs": "constant.sha.git-rebase: #09885A", + "light_vs": "constant.sha.git-rebase: #098658", "hc_black": "constant.sha.git-rebase: #B5CEA8" } }, @@ -81,9 +81,9 @@ "t": "text.git-rebase meta.commit-command.git-rebase constant.sha.git-rebase", "r": { "dark_plus": "constant.sha.git-rebase: #B5CEA8", - "light_plus": "constant.sha.git-rebase: #09885A", + "light_plus": "constant.sha.git-rebase: #098658", "dark_vs": "constant.sha.git-rebase: #B5CEA8", - "light_vs": "constant.sha.git-rebase: #09885A", + "light_vs": "constant.sha.git-rebase: #098658", "hc_black": "constant.sha.git-rebase: #B5CEA8" } }, @@ -136,9 +136,9 @@ "t": "text.git-rebase meta.commit-command.git-rebase constant.sha.git-rebase", "r": { "dark_plus": "constant.sha.git-rebase: #B5CEA8", - "light_plus": "constant.sha.git-rebase: #09885A", + "light_plus": "constant.sha.git-rebase: #098658", "dark_vs": "constant.sha.git-rebase: #B5CEA8", - "light_vs": "constant.sha.git-rebase: #09885A", + "light_vs": "constant.sha.git-rebase: #098658", "hc_black": "constant.sha.git-rebase: #B5CEA8" } }, @@ -191,9 +191,9 @@ "t": "text.git-rebase meta.commit-command.git-rebase constant.sha.git-rebase", "r": { "dark_plus": "constant.sha.git-rebase: #B5CEA8", - "light_plus": "constant.sha.git-rebase: #09885A", + "light_plus": "constant.sha.git-rebase: #098658", "dark_vs": "constant.sha.git-rebase: #B5CEA8", - "light_vs": "constant.sha.git-rebase: #09885A", + "light_vs": "constant.sha.git-rebase: #098658", "hc_black": "constant.sha.git-rebase: #B5CEA8" } }, @@ -246,9 +246,9 @@ "t": "text.git-rebase meta.commit-command.git-rebase constant.sha.git-rebase", "r": { "dark_plus": "constant.sha.git-rebase: #B5CEA8", - "light_plus": "constant.sha.git-rebase: #09885A", + "light_plus": "constant.sha.git-rebase: #098658", "dark_vs": "constant.sha.git-rebase: #B5CEA8", - "light_vs": "constant.sha.git-rebase: #09885A", + "light_vs": "constant.sha.git-rebase: #098658", "hc_black": "constant.sha.git-rebase: #B5CEA8" } }, @@ -301,9 +301,9 @@ "t": "text.git-rebase meta.commit-command.git-rebase constant.sha.git-rebase", "r": { "dark_plus": "constant.sha.git-rebase: #B5CEA8", - "light_plus": "constant.sha.git-rebase: #09885A", + "light_plus": "constant.sha.git-rebase: #098658", "dark_vs": "constant.sha.git-rebase: #B5CEA8", - "light_vs": "constant.sha.git-rebase: #09885A", + "light_vs": "constant.sha.git-rebase: #098658", "hc_black": "constant.sha.git-rebase: #B5CEA8" } }, @@ -356,9 +356,9 @@ "t": "text.git-rebase meta.commit-command.git-rebase constant.sha.git-rebase", "r": { "dark_plus": "constant.sha.git-rebase: #B5CEA8", - "light_plus": "constant.sha.git-rebase: #09885A", + "light_plus": "constant.sha.git-rebase: #098658", "dark_vs": "constant.sha.git-rebase: #B5CEA8", - "light_vs": "constant.sha.git-rebase: #09885A", + "light_vs": "constant.sha.git-rebase: #098658", "hc_black": "constant.sha.git-rebase: #B5CEA8" } }, @@ -538,4 +538,4 @@ "hc_black": "comment: #7CA668" } } -] \ No newline at end of file +] diff --git a/extensions/groovy/test/colorize-results/test_groovy.json b/extensions/groovy/test/colorize-results/test_groovy.json index 13aa74462a8..e6f3166fa05 100644 --- a/extensions/groovy/test/colorize-results/test_groovy.json +++ b/extensions/groovy/test/colorize-results/test_groovy.json @@ -191,9 +191,9 @@ "t": "source.groovy meta.definition.variable.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -356,9 +356,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4569,9 +4569,9 @@ "t": "source.groovy meta.definition.variable.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4613,9 +4613,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4767,9 +4767,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5053,9 +5053,9 @@ "t": "source.groovy meta.definition.variable.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5152,9 +5152,9 @@ "t": "source.groovy meta.definition.variable.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5812,9 +5812,9 @@ "t": "source.groovy meta.definition.variable.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5867,9 +5867,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5911,9 +5911,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6043,9 +6043,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6109,9 +6109,9 @@ "t": "source.groovy meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6131,9 +6131,9 @@ "t": "source.groovy meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6153,9 +6153,9 @@ "t": "source.groovy meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6175,9 +6175,9 @@ "t": "source.groovy meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6318,9 +6318,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6340,9 +6340,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6439,9 +6439,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6967,9 +6967,9 @@ "t": "source.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7517,9 +7517,9 @@ "t": "source.groovy meta.definition.variable.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7979,9 +7979,9 @@ "t": "source.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8001,9 +8001,9 @@ "t": "source.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8089,9 +8089,9 @@ "t": "source.groovy meta.definition.variable.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8287,9 +8287,9 @@ "t": "source.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8650,9 +8650,9 @@ "t": "source.groovy meta.definition.variable.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9321,9 +9321,9 @@ "t": "source.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9354,9 +9354,9 @@ "t": "source.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9728,9 +9728,9 @@ "t": "source.groovy meta.definition.method.groovy meta.method.body.java meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9750,9 +9750,9 @@ "t": "source.groovy meta.definition.method.groovy meta.method.body.java meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9772,9 +9772,9 @@ "t": "source.groovy meta.definition.method.groovy meta.method.body.java meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9794,9 +9794,9 @@ "t": "source.groovy meta.definition.method.groovy meta.method.body.java meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9882,9 +9882,9 @@ "t": "source.groovy meta.definition.method.groovy meta.method.body.java meta.structure.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -10344,9 +10344,9 @@ "t": "source.groovy meta.declaration.assertion.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -10366,9 +10366,9 @@ "t": "source.groovy meta.declaration.assertion.groovy meta.method-call.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -10421,10 +10421,10 @@ "t": "source.groovy meta.declaration.assertion.groovy constant.numeric.groovy", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } } -] \ No newline at end of file +] diff --git a/extensions/html-language-features/client/src/htmlMain.ts b/extensions/html-language-features/client/src/htmlMain.ts index 2df5e7f5c13..c54a97f9b07 100644 --- a/extensions/html-language-features/client/src/htmlMain.ts +++ b/extensions/html-language-features/client/src/htmlMain.ts @@ -11,7 +11,7 @@ const localize = nls.loadMessageBundle(); import { languages, ExtensionContext, IndentAction, Position, TextDocument, Range, CompletionItem, CompletionItemKind, SnippetString, workspace, Disposable, FormattingOptions, CancellationToken, ProviderResult, TextEdit, CompletionContext, CompletionList, SemanticTokensLegend, - SemanticTokensProvider, SemanticTokens + DocumentSemanticTokensProvider, DocumentRangeSemanticTokensProvider, SemanticTokens } from 'vscode'; import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, TextDocumentPositionParams, DocumentRangeFormattingParams, @@ -96,9 +96,8 @@ export function activate(context: ExtensionContext) { provideCompletionItem(document: TextDocument, position: Position, context: CompletionContext, token: CancellationToken, next: ProvideCompletionItemsSignature): ProviderResult { function updateRanges(item: CompletionItem) { const range = item.range; - if (range && range.end.isAfter(position) && range.start.isBeforeOrEqual(position)) { - item.range2 = { inserting: new Range(range.start, position), replacing: range }; - item.range = undefined; + if (range instanceof Range && range.end.isAfter(position) && range.start.isBeforeOrEqual(position)) { + item.range = { inserting: new Range(range.start, position), replacing: range }; } } function updateProposals(r: CompletionItem[] | CompletionList | null | undefined): CompletionItem[] | CompletionList | null | undefined { @@ -154,18 +153,26 @@ export function activate(context: ExtensionContext) { client.sendRequest(SemanticTokenLegendRequest.type).then(legend => { if (legend) { - const provider: SemanticTokensProvider = { - provideSemanticTokens(doc, opts) { + const provider: DocumentSemanticTokensProvider & DocumentRangeSemanticTokensProvider = { + provideDocumentSemanticTokens(doc) { const params: SemanticTokenParams = { textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(doc), - ranges: opts.ranges?.map(r => client.code2ProtocolConverter.asRange(r)) + }; + return client.sendRequest(SemanticTokenRequest.type, params).then(data => { + return data && new SemanticTokens(new Uint32Array(data)); + }); + }, + provideDocumentRangeSemanticTokens(doc, range) { + const params: SemanticTokenParams = { + textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(doc), + ranges: [client.code2ProtocolConverter.asRange(range)] }; return client.sendRequest(SemanticTokenRequest.type, params).then(data => { return data && new SemanticTokens(new Uint32Array(data)); }); } }; - toDispose.push(languages.registerSemanticTokensProvider(documentSelector, provider, new SemanticTokensLegend(legend.types, legend.modifiers))); + toDispose.push(languages.registerDocumentSemanticTokensProvider(documentSelector, provider, new SemanticTokensLegend(legend.types, legend.modifiers))); } }); diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index 696c2dda852..b38816350e3 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -164,7 +164,7 @@ "html.mirrorCursorOnMatchingTag": { "type": "boolean", "scope": "resource", - "default": true, + "default": false, "description": "%html.mirrorCursorOnMatchingTag%" }, "html.trace.server": { diff --git a/extensions/html-language-features/server/src/modes/javascriptSemanticTokens.ts b/extensions/html-language-features/server/src/modes/javascriptSemanticTokens.ts index fa615319354..2f91c3d1486 100644 --- a/extensions/html-language-features/server/src/modes/javascriptSemanticTokens.ts +++ b/extensions/html-language-features/server/src/modes/javascriptSemanticTokens.ts @@ -6,40 +6,66 @@ import { TextDocument, SemanticTokenData } from './languageModes'; import * as ts from 'typescript'; +export function getSemanticTokenLegend() { + if (tokenTypes.length !== TokenType._) { + console.warn('TokenType has added new entries.'); + } + if (tokenModifiers.length !== TokenModifier._) { + console.warn('TokenModifier has added new entries.'); + } + return { types: tokenTypes, modifiers: tokenModifiers }; +} export function getSemanticTokens(jsLanguageService: ts.LanguageService, currentTextDocument: TextDocument, fileName: string): SemanticTokenData[] { //https://ts-ast-viewer.com/#code/AQ0g2CmAuwGbALzAJwG4BQZQGNwEMBnQ4AQQEYBmYAb2C22zgEtJwATJVTRxgcwD27AQAp8AGmAAjAJS0A9POB8+7NQ168oscAJz5wANXwAnLug2bsJmAFcTAO2XAA1MHyvgu-UdOeWbOw8ViAAvpagocBAA let resultTokens: SemanticTokenData[] = []; + const collector = (node: ts.Node, typeIdx: number, modifierSet: number) => { + resultTokens.push({ start: currentTextDocument.positionAt(node.getStart()), length: node.getWidth(), typeIdx, modifierSet }); + }; + collectTokens(jsLanguageService, fileName, { start: 0, length: currentTextDocument.getText().length }, collector); + + return resultTokens; +} + +function collectTokens(jsLanguageService: ts.LanguageService, fileName: string, span: ts.TextSpan, collector: (node: ts.Node, tokenType: number, tokenModifier: number) => void) { const program = jsLanguageService.getProgram(); if (program) { const typeChecker = program.getTypeChecker(); function visit(node: ts.Node) { - if (node.kind === ts.SyntaxKind.Identifier) { - const symbol = typeChecker.getSymbolAtLocation(node); + if (!node || !ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { + return; + } + if (ts.isIdentifier(node)) { + let symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { - const decl = symbol.valueDeclaration || symbol.declarations[0]; - if (decl) { - let typeIdx = tokenFromDeclarationMapping[decl.kind]; + if (symbol.flags & ts.SymbolFlags.Alias) { + symbol = typeChecker.getAliasedSymbol(symbol); + } + let typeIdx = classifySymbol(symbol); + if (typeIdx !== undefined) { let modifierSet = 0; if (node.parent) { const parentTypeIdx = tokenFromDeclarationMapping[node.parent.kind]; if (parentTypeIdx === typeIdx && (node.parent).name === node) { - modifierSet = TokenModifier.declaration; + modifierSet = 1 << TokenModifier.declaration; } } - const modifiers = ts.getCombinedModifierFlags(decl); + const decl = symbol.valueDeclaration; + const modifiers = decl ? ts.getCombinedModifierFlags(decl) : 0; + const nodeFlags = decl ? ts.getCombinedNodeFlags(decl) : 0; if (modifiers & ts.ModifierFlags.Static) { - modifierSet |= TokenModifier.static; + modifierSet |= 1 << TokenModifier.static; } if (modifiers & ts.ModifierFlags.Async) { - modifierSet |= TokenModifier.async; + modifierSet |= 1 << TokenModifier.async; } - if (typeIdx !== undefined) { - resultTokens.push({ start: currentTextDocument.positionAt(node.getStart()), length: node.getWidth(), typeIdx, modifierSet }); + if ((modifiers & ts.ModifierFlags.Readonly) || (nodeFlags & ts.NodeFlags.Const) || (symbol.getFlags() & ts.SymbolFlags.EnumMember)) { + modifierSet |= 1 << TokenModifier.readonly; } + collector(node, typeIdx, modifierSet); } } } @@ -51,41 +77,54 @@ export function getSemanticTokens(jsLanguageService: ts.LanguageService, current visit(sourceFile); } } - - return resultTokens; } - -export function getSemanticTokenLegend() { - return { types: tokenTypes, modifiers: tokenModifiers }; +function classifySymbol(symbol: ts.Symbol) { + const flags = symbol.getFlags(); + if (flags & ts.SymbolFlags.Class) { + return TokenType.class; + } else if (flags & ts.SymbolFlags.Enum) { + return TokenType.enum; + } else if (flags & ts.SymbolFlags.TypeAlias) { + return TokenType.type; + } else if (flags & ts.SymbolFlags.Type) { + if (flags & ts.SymbolFlags.Interface) { + return TokenType.interface; + } if (flags & ts.SymbolFlags.TypeParameter) { + return TokenType.typeParameter; + } + } + const decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; + return decl && tokenFromDeclarationMapping[decl.kind]; } - -const tokenTypes: string[] = ['class', 'enum', 'interface', 'namespace', 'typeParameter', 'type', 'parameter', 'variable', 'property', 'constant', 'function', 'member']; -const tokenModifiers: string[] = ['declaration', 'static', 'async']; - -const enum TokenType { - 'class' = 0, - 'enum' = 1, - 'interface' = 2, - 'namespace' = 3, - 'typeParameter' = 4, - 'type' = 5, - 'parameter' = 6, - 'variable' = 7, - 'property' = 8, - 'constant' = 9, - 'function' = 10, - 'member' = 11 +export const enum TokenType { + class, enum, interface, namespace, typeParameter, type, parameter, variable, property, function, member, _ } - -const enum TokenModifier { - 'declaration' = 0x01, - 'static' = 0x02, - 'async' = 0x04, +export const enum TokenModifier { + declaration, static, async, readonly, _ } +const tokenTypes: string[] = []; +tokenTypes[TokenType.class] = 'class'; +tokenTypes[TokenType.enum] = 'enum'; +tokenTypes[TokenType.interface] = 'interface'; +tokenTypes[TokenType.namespace] = 'namespace'; +tokenTypes[TokenType.typeParameter] = 'typeParameter'; +tokenTypes[TokenType.type] = 'type'; +tokenTypes[TokenType.parameter] = 'parameter'; +tokenTypes[TokenType.variable] = 'variable'; +tokenTypes[TokenType.property] = 'property'; +tokenTypes[TokenType.function] = 'function'; +tokenTypes[TokenType.member] = 'member'; + +const tokenModifiers: string[] = []; +tokenModifiers[TokenModifier.async] = 'async'; +tokenModifiers[TokenModifier.declaration] = 'declaration'; +tokenModifiers[TokenModifier.readonly] = 'readonly'; +tokenModifiers[TokenModifier.static] = 'static'; + const tokenFromDeclarationMapping: { [name: string]: TokenType } = { [ts.SyntaxKind.VariableDeclaration]: TokenType.variable, [ts.SyntaxKind.Parameter]: TokenType.parameter, diff --git a/extensions/html-language-features/server/src/test/semanticTokens.test.ts b/extensions/html-language-features/server/src/test/semanticTokens.test.ts index 0408b3ccdbf..ea3777e84e9 100644 --- a/extensions/html-language-features/server/src/test/semanticTokens.test.ts +++ b/extensions/html-language-features/server/src/test/semanticTokens.test.ts @@ -55,7 +55,7 @@ suite('HTML Semantic Tokens', () => { /*2*/'', + /*8*/'', + /*9*/'', + ]; + assertTokens(input, [ + t(3, 8, 1, 'variable.declaration.readonly'), + t(4, 8, 1, 'class.declaration'), t(4, 28, 1, 'property.declaration.static.readonly'), t(4, 42, 3, 'property.declaration.static'), t(4, 47, 3, 'interface'), + t(5, 13, 1, 'enum.declaration'), t(5, 17, 1, 'property.declaration.readonly'), t(5, 24, 1, 'property.declaration.readonly'), t(5, 28, 1, 'property.readonly'), + t(6, 2, 7, 'variable'), t(6, 10, 3, 'member'), t(6, 14, 1, 'variable.readonly'), t(6, 18, 1, 'class'), t(6, 20, 1, 'property.static.readonly'), t(6, 24, 1, 'class'), t(6, 26, 3, 'property.static'), t(6, 30, 6, 'property.readonly'), ]); }); @@ -154,9 +175,9 @@ suite('HTML Semantic Tokens', () => { /*9*/'', ]; assertTokens(input, [ - t(3, 7, 5, 'type.declaration'), t(3, 15, 3, 'variable') /* to investiagte */, + t(3, 7, 5, 'type.declaration'), t(3, 15, 3, 'interface') /* to investiagte */, t(4, 11, 1, 'function.declaration'), t(4, 13, 1, 'typeParameter.declaration'), t(4, 23, 5, 'type'), t(4, 30, 1, 'parameter.declaration'), t(4, 33, 1, 'typeParameter'), t(4, 47, 1, 'typeParameter'), - t(5, 12, 1, 'typeParameter'), t(5, 29, 3, 'variable'), t(5, 41, 5, 'type'), + t(5, 12, 1, 'typeParameter'), t(5, 29, 3, 'interface'), t(5, 41, 5, 'type'), ]); }); diff --git a/extensions/html/test/colorize-results/25920_html.json b/extensions/html/test/colorize-results/25920_html.json index 73c94747231..9aa58b607aa 100644 --- a/extensions/html/test/colorize-results/25920_html.json +++ b/extensions/html/test/colorize-results/25920_html.json @@ -499,9 +499,9 @@ "t": "text.html.derivative meta.embedded.block.html source.js meta.var.expr.js constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1011,4 +1011,4 @@ "hc_black": "punctuation.definition.tag: #808080" } } -] \ No newline at end of file +] diff --git a/extensions/image-preview/media/main.css b/extensions/image-preview/media/main.css index ff3e6d0f0d2..49a01b8d969 100644 --- a/extensions/image-preview/media/main.css +++ b/extensions/image-preview/media/main.css @@ -94,16 +94,16 @@ body img { } .loading-indicator, -.image-load-error-message { +.image-load-error { display: none; } .loading .loading-indicator, -.error .image-load-error-message { +.error .image-load-error { display: block; } -.image-load-error-message { +.image-load-error { margin: 1em; } diff --git a/extensions/image-preview/media/main.js b/extensions/image-preview/media/main.js index 3e2abf4ee98..394511aa8ef 100644 --- a/extensions/image-preview/media/main.js +++ b/extensions/image-preview/media/main.js @@ -305,6 +305,12 @@ image.src = settings.src; + document.querySelector('.open-file-link').addEventListener('click', () => { + vscode.postMessage({ + type: 'reopen-as-text', + }); + }); + window.addEventListener('message', e => { switch (e.data.type) { case 'setScale': diff --git a/extensions/image-preview/src/preview.ts b/extensions/image-preview/src/preview.ts index dc2e6676245..5e733b13cc2 100644 --- a/extensions/image-preview/src/preview.ts +++ b/extensions/image-preview/src/preview.ts @@ -73,6 +73,8 @@ class Preview extends Disposable { private _imageBinarySize: number | undefined; private _imageZoom: Scale | undefined; + private readonly emptyPngDataUri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAEElEQVR42gEFAPr/AP///wAI/AL+Sr4t6gAAAABJRU5ErkJggg=='; + constructor( private readonly extensionRoot: vscode.Uri, private readonly resource: vscode.Uri, @@ -108,6 +110,12 @@ class Preview extends Disposable { this.update(); break; } + + case 'reopen-as-text': + { + vscode.commands.executeCommand('vscode.openWith', resource, 'default', webviewEditor.viewColumn); + break; + } } })); @@ -165,9 +173,9 @@ class Preview extends Disposable { } } - private render() { + private async render() { if (this._previewState !== PreviewState.Disposed) { - this.webviewEditor.webview.html = this.getWebiewContents(); + this.webviewEditor.webview.html = await this.getWebiewContents(); } } @@ -191,11 +199,11 @@ class Preview extends Disposable { } } - private getWebiewContents(): string { + private async getWebiewContents(): Promise { const version = Date.now().toString(); const settings = { isMac: process.platform === 'darwin', - src: this.getResourcePath(this.webviewEditor, this.resource, version), + src: await this.getResourcePath(this.webviewEditor, this.resource, version), }; const nonce = Date.now().toString(); @@ -218,28 +226,28 @@ class Preview extends Disposable {
-
${localize('preview.imageLoadError', "An error occurred while loading the image")}
+
+

${localize('preview.imageLoadError', "An error occurred while loading the image.")}

+ ${localize('preview.imageLoadErrorLink', "Open file using VS Code's standard text/binary editor?")} +
`; } - private getResourcePath(webviewEditor: vscode.WebviewPanel, resource: vscode.Uri, version: string) { - switch (resource.scheme) { - case 'data': - return resource.toString(true); - - case 'git': - // Show blank image - return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAEElEQVR42gEFAPr/AP///wAI/AL+Sr4t6gAAAABJRU5ErkJggg=='; - - default: - // Avoid adding cache busting if there is already a query string - if (resource.query) { - return webviewEditor.webview.asWebviewUri(resource).toString(true); - } - return webviewEditor.webview.asWebviewUri(resource).with({ query: `version=${version}` }).toString(true); + private async getResourcePath(webviewEditor: vscode.WebviewPanel, resource: vscode.Uri, version: string): Promise { + if (resource.scheme === 'git') { + const stat = await vscode.workspace.fs.stat(resource); + if (stat.size === 0) { + return this.emptyPngDataUri; + } } + + // Avoid adding cache busting if there is already a query string + if (resource.query) { + return webviewEditor.webview.asWebviewUri(resource).toString(true); + } + return webviewEditor.webview.asWebviewUri(resource).with({ query: `version=${version}` }).toString(true); } private extensionResource(path: string) { diff --git a/extensions/java/test/colorize-results/basic_java.json b/extensions/java/test/colorize-results/basic_java.json index 0032d405471..ad37c62402e 100644 --- a/extensions/java/test/colorize-results/basic_java.json +++ b/extensions/java/test/colorize-results/basic_java.json @@ -763,9 +763,9 @@ "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -862,9 +862,9 @@ "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -961,9 +961,9 @@ "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1434,9 +1434,9 @@ "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1489,9 +1489,9 @@ "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1786,9 +1786,9 @@ "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.decimal.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2083,9 +2083,9 @@ "t": "source.java meta.class.java meta.class.body.java meta.method.java meta.method.body.java constant.numeric.hex.java", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2309,4 +2309,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json index 54169e925da..c18fb6cfef7 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScript.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/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f065e7e88d1c20160c5ec92455aad99a1016284f", "name": "JavaScript (with React support)", "scopeName": "source.js", "patterns": [ @@ -1081,13 +1081,13 @@ }, "field-declaration": { "name": "meta.field.declaration.js", - "begin": "(?x)(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(\\#?[_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.js entity.name.function.js" @@ -1123,7 +1123,7 @@ }, { "name": "meta.definition.property.js variable.object.property.js", - "match": "[_$[:alpha:]][_$[:alnum:]]*" + "match": "\\#?[_$[:alpha:]][_$[:alnum:]]*" }, { "name": "keyword.operator.optional.js", @@ -1998,7 +1998,7 @@ "patterns": [ { "name": "meta.import-equals.external.js", - "begin": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", - "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { "name": "meta.function-call.js", - "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))", "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { @@ -2834,7 +2849,7 @@ }, { "name": "entity.name.function.js", - "match": "([_$[:alpha:]][_$[:alnum:]]*)" + "match": "(\\#?[_$[:alpha:]][_$[:alnum:]]*)" } ] }, @@ -3626,7 +3641,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "captures": { "1": { "name": "punctuation.accessor.js" @@ -3640,7 +3655,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.js" @@ -3670,7 +3685,7 @@ "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))" }, { - "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.js" @@ -3687,7 +3702,7 @@ } }, { - "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "variable.other.constant.object.js" diff --git a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json b/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json index 9c5e4e15474..29cd81e4ab3 100644 --- a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScriptReact.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/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f065e7e88d1c20160c5ec92455aad99a1016284f", "name": "JavaScript (with React support)", "scopeName": "source.js.jsx", "patterns": [ @@ -1081,13 +1081,13 @@ }, "field-declaration": { "name": "meta.field.declaration.js.jsx", - "begin": "(?x)(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(\\#?[_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.js.jsx entity.name.function.js.jsx" @@ -1123,7 +1123,7 @@ }, { "name": "meta.definition.property.js.jsx variable.object.property.js.jsx", - "match": "[_$[:alpha:]][_$[:alnum:]]*" + "match": "\\#?[_$[:alpha:]][_$[:alnum:]]*" }, { "name": "keyword.operator.optional.js.jsx", @@ -1998,7 +1998,7 @@ "patterns": [ { "name": "meta.import-equals.external.js.jsx", - "begin": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", - "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { "name": "meta.function-call.js.jsx", - "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))", "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { @@ -2834,7 +2849,7 @@ }, { "name": "entity.name.function.js.jsx", - "match": "([_$[:alpha:]][_$[:alnum:]]*)" + "match": "(\\#?[_$[:alpha:]][_$[:alnum:]]*)" } ] }, @@ -3626,7 +3641,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "captures": { "1": { "name": "punctuation.accessor.js.jsx" @@ -3640,7 +3655,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.js.jsx" @@ -3670,7 +3685,7 @@ "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))" }, { - "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.js.jsx" @@ -3687,7 +3702,7 @@ } }, { - "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "variable.other.constant.object.js.jsx" diff --git a/extensions/javascript/test/colorize-results/test6916_js.json b/extensions/javascript/test/colorize-results/test6916_js.json index a3e9cc286fc..43202202c1c 100644 --- a/extensions/javascript/test/colorize-results/test6916_js.json +++ b/extensions/javascript/test/colorize-results/test6916_js.json @@ -70,9 +70,9 @@ "t": "source.js meta.var.expr.js constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -114,9 +114,9 @@ "t": "source.js constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -400,9 +400,9 @@ "t": "source.js meta.block.js meta.block.js constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -505,4 +505,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/javascript/test/colorize-results/test_js.json b/extensions/javascript/test/colorize-results/test_js.json index 6ba00939cdf..3bb11179381 100644 --- a/extensions/javascript/test/colorize-results/test_js.json +++ b/extensions/javascript/test/colorize-results/test_js.json @@ -3315,9 +3315,9 @@ "t": "source.js meta.function.js meta.block.js meta.var.expr.js constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3838,4 +3838,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index 32c0d422643..b52141b947c 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -117,7 +117,8 @@ export function activate(context: ExtensionContext) { documentSelector, initializationOptions: { handledSchemaProtocols: ['file'], // language server only loads file-URI. Fetching schemas with other protocols ('http'...) are made on the client. - provideFormatter: false // tell the server to not provide formatting capability and ignore the `json.format.enable` setting. + provideFormatter: false, // tell the server to not provide formatting capability and ignore the `json.format.enable` setting. + customCapabilities: { rangeFormatting: { editLimit: 1000 } } }, synchronize: { // Synchronize the setting section 'json' to the server @@ -149,9 +150,8 @@ export function activate(context: ExtensionContext) { provideCompletionItem(document: TextDocument, position: Position, context: CompletionContext, token: CancellationToken, next: ProvideCompletionItemsSignature): ProviderResult { function updateRanges(item: CompletionItem) { const range = item.range; - if (range && range.end.isAfter(position) && range.start.isBeforeOrEqual(position)) { - item.range2 = { inserting: new Range(range.start, position), replacing: range }; - item.range = undefined; + if (range instanceof Range && range.end.isAfter(position) && range.start.isBeforeOrEqual(position)) { + item.range = { inserting: new Range(range.start, position), replacing: range }; } } function updateProposals(r: CompletionItem[] | CompletionList | null | undefined): CompletionItem[] | CompletionList | null | undefined { diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json index 09f7c6c1643..dfceebce8e7 100644 --- a/extensions/json-language-features/package.json +++ b/extensions/json-language-features/package.json @@ -111,12 +111,16 @@ }, "editor.suggest.insertMode": "replace" } - } + }, + "jsonValidation": [{ + "fileMatch": "*.schema.json", + "url": "http://json-schema.org/draft-07/schema#" + }] }, "dependencies": { "request-light": "^0.2.5", "vscode-extension-telemetry": "0.1.1", - "vscode-languageclient": "^6.0.0-next.3", + "vscode-languageclient": "^6.0.1", "vscode-nls": "^4.1.1" }, "devDependencies": { diff --git a/extensions/json-language-features/server/README.md b/extensions/json-language-features/server/README.md index 66fd8437d6a..43cc04837d5 100644 --- a/extensions/json-language-features/server/README.md +++ b/extensions/json-language-features/server/README.md @@ -46,6 +46,8 @@ The client can send the following initialization options to the server: - `provideFormatter: boolean | undefined`. If defined, the value defines whether the server provides the `documentRangeFormattingProvider` capability on initialization. If undefined, the setting `json.format.enable` is used to determine whether formatting is provided. The formatter will then be registered through dynamic registration. If the client does not support dynamic registration, no formatter will be available. - `handledSchemaProtocols`: The URI schemas handles by the server. See section `Schema configuration` below. +- `customCapabilities`: Additional non-LSP client capabilities: + - `rangeFormatting: { editLimit: x } }`: For performance reasons, limit the number of edits returned by the range formatter to `x`. ### Settings diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index 64a9c5f5eba..0c26777f01f 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -14,8 +14,8 @@ "dependencies": { "jsonc-parser": "^2.2.0", "request-light": "^0.2.5", - "vscode-json-languageservice": "^3.4.9", - "vscode-languageserver": "^6.0.0-next.3", + "vscode-json-languageservice": "^3.4.12", + "vscode-languageserver": "^6.0.1", "vscode-uri": "^2.1.1" }, "devDependencies": { diff --git a/extensions/json-language-features/server/src/jsonServerMain.ts b/extensions/json-language-features/server/src/jsonServerMain.ts index 4b058d12350..fb8a93aab2b 100644 --- a/extensions/json-language-features/server/src/jsonServerMain.ts +++ b/extensions/json-language-features/server/src/jsonServerMain.ts @@ -6,7 +6,7 @@ import { createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult, NotificationType, RequestType, - DocumentRangeFormattingRequest, Disposable, ServerCapabilities, TextDocumentSyncKind + DocumentRangeFormattingRequest, Disposable, ServerCapabilities, TextDocumentSyncKind, TextEdit } from 'vscode-languageserver'; import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription } from 'request-light'; @@ -16,7 +16,7 @@ import * as URL from 'url'; import { posix } from 'path'; import { setTimeout, clearTimeout } from 'timers'; import { formatError, runSafe, runSafeAsync } from './utils/runner'; -import { TextDocument, JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration, ClientCapabilities, SchemaRequestService, Diagnostic } from 'vscode-json-languageservice'; +import { TextDocument, JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration, ClientCapabilities, SchemaRequestService, Diagnostic, Range, Position } from 'vscode-json-languageservice'; import { getLanguageModelCache } from './languageModelCache'; interface ISchemaAssociations { @@ -126,12 +126,13 @@ let hierarchicalDocumentSymbolSupport = false; let foldingRangeLimitDefault = Number.MAX_VALUE; let foldingRangeLimit = Number.MAX_VALUE; let resultLimit = Number.MAX_VALUE; +let formatterMaxNumberOfEdits = Number.MAX_VALUE; // After the server has started the client sends an initialize request. The server receives // in the passed params the rootPath of the workspace plus the client capabilities. connection.onInitialize((params: InitializeParams): InitializeResult => { - const handledProtocols = params.initializationOptions && params.initializationOptions['handledSchemaProtocols']; + const handledProtocols = params.initializationOptions?.handledSchemaProtocols; languageService = getLanguageService({ schemaRequestService: getSchemaRequestService(handledProtocols), @@ -153,9 +154,10 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { } clientSnippetSupport = getClientCapability('textDocument.completion.completionItem.snippetSupport', false); - dynamicFormatterRegistration = getClientCapability('textDocument.rangeFormatting.dynamicRegistration', false) && (typeof params.initializationOptions.provideFormatter !== 'boolean'); + dynamicFormatterRegistration = getClientCapability('textDocument.rangeFormatting.dynamicRegistration', false) && (typeof params.initializationOptions?.provideFormatter !== 'boolean'); foldingRangeLimitDefault = getClientCapability('textDocument.foldingRange.rangeLimit', Number.MAX_VALUE); hierarchicalDocumentSymbolSupport = getClientCapability('textDocument.documentSymbol.hierarchicalDocumentSymbolSupport', false); + formatterMaxNumberOfEdits = params.initializationOptions?.customCapabilities?.rangeFormatting?.editLimit || Number.MAX_VALUE; const capabilities: ServerCapabilities = { textDocumentSync: TextDocumentSyncKind.Incremental, completionProvider: clientSnippetSupport ? { resolveProvider: true, triggerCharacters: ['"', ':'] } : undefined, @@ -445,7 +447,12 @@ connection.onDocumentRangeFormatting((formatParams, token) => { return runSafe(() => { const document = documents.get(formatParams.textDocument.uri); if (document) { - return languageService.format(document, formatParams.range, formatParams.options); + const edits = languageService.format(document, formatParams.range, formatParams.options); + if (edits.length > formatterMaxNumberOfEdits) { + const newText = TextDocument.applyEdits(document, edits); + return [TextEdit.replace(Range.create(Position.create(0, 0), document.positionAt(document.getText().length - 1)), newText)]; + } + return edits; } return []; }, [], `Error while formatting range for ${formatParams.textDocument.uri}`, token); diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index 7ebc93341c6..9c72cea8b07 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -80,57 +80,52 @@ request-light@^0.2.5: https-proxy-agent "^2.2.3" vscode-nls "^4.1.1" -vscode-json-languageservice@^3.4.9: - version "3.4.9" - resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.4.9.tgz#7ce485bb0f9a07b4d879c988baac9be2222909ad" - integrity sha512-4VCpZ9ooea/Zc/MTnj1ccc9C7rqcoinKVQLhLoi6jw6yueSf4y4tg/YIUiPPVMlEAG7ZCPS+NVmqxisQ+mOsSw== +vscode-json-languageservice@^3.4.12: + version "3.4.12" + resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.4.12.tgz#e7c96a1824896a624cc7bb14f46fbf9cb7e6c5a3" + integrity sha512-+tA0KPVM1pDfORZqsQen7bY5buBpQGDTVYEobm5MoGtXNeZY2Kn0iy5wIQqXveb28LRv/I5xKE87dmNJTEaijQ== dependencies: jsonc-parser "^2.2.0" - vscode-languageserver-textdocument "^1.0.0-next.4" - vscode-languageserver-types "^3.15.0-next.6" + vscode-languageserver-textdocument "^1.0.1-next.1" + vscode-languageserver-types "^3.15.0" vscode-nls "^4.1.1" - vscode-uri "^2.1.0" + vscode-uri "^2.1.1" -vscode-jsonrpc@^5.0.0-next.2: - version "5.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.0-next.2.tgz#a44bc03f67069e53f8d8beb88b96c0cacbfefbca" - integrity sha512-Q3/jabZUNviCG9hhF6hHWjhrABevPF9mv0aiE2j8BYCAP2k+aHTpjMyk+04MzaAqWYwXdQuZkLSbcYCCqbzJLg== +vscode-jsonrpc@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz#9bab9c330d89f43fc8c1e8702b5c36e058a01794" + integrity sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A== -vscode-languageserver-protocol@^3.15.0-next.10: - version "3.15.0-next.10" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.10.tgz#f1382f0c270ae5d0c2c7e552483285fb75810914" - integrity sha512-TmbBhKrBoYNX+/pQGwoXmy2qlOfjGBUhwUGIzQoWpj8qtDzYuLof8bi19rGLZ9sVuSHh3anvIyVpGJEqT0QODQ== +vscode-languageserver-protocol@^3.15.1: + version "3.15.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.1.tgz#7555e595f0058b9a166f14605ad039e97fab320a" + integrity sha512-wJAo06VM9ZBnRqslplDjfz6Tdive0O7z44yNxBFA3x0/YZkXBIL6I+9rwQ/9Y//0X0eCh12FQrj+KmEXf2L5eA== dependencies: - vscode-jsonrpc "^5.0.0-next.2" - vscode-languageserver-types "^3.15.0-next.6" + vscode-jsonrpc "^5.0.1" + vscode-languageserver-types "3.15.0" -vscode-languageserver-textdocument@^1.0.0-next.4: - version "1.0.0-next.4" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.0-next.4.tgz#8f7afdfe3e81411f57baaa29bb3214d1907160cd" - integrity sha512-LJ5WfoBO54nqinjlLJKnjoo2Im4bIvPJ8bFT7R0C84ZI36iK8M29ddslfe5jUeWNSTtCda7YuKdKsDIq38HpgA== +vscode-languageserver-textdocument@^1.0.1-next.1: + version "1.0.1-next.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.1-next.1.tgz#c8f2f792c7c88d33ea8441ca04bfb8376896b671" + integrity sha512-Cmt0KsNxouns+d7/Kw/jWtWU9Z3h56z1qAA8utjDOEqrDcrTs2rDXv3EJRa99nuKM3wVf6DbWym1VqL9q71XPA== -vscode-languageserver-types@^3.15.0-next.6: - version "3.15.0-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.6.tgz#7a990d00c39ad4e744335afb4cc422a3e687ff25" - integrity sha512-+4jfvmZ26oFMSX6EgPRB75PWHoT8pzyWuSSWk0erC4hTzmJq2gWxVLh20bZutZjMmiivawvPshtM3XZhX2SttA== +vscode-languageserver-types@3.15.0, vscode-languageserver-types@^3.15.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0.tgz#c45a23308ec0967135c483b759dfaf97978d9e0a" + integrity sha512-AXteNagMhBWnZ6gNN0UB4HTiD/7TajgfHl6jaM6O7qz3zDJw0H3Jf83w05phihnBRCML+K6Ockh8f8bL0OObPw== -vscode-languageserver@^6.0.0-next.3: - version "6.0.0-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-6.0.0-next.3.tgz#41e2fda6417939792f6a19fc19ecbb2f080e2072" - integrity sha512-Q6T+KwYuoXV9KRHD6x7RfTU13pV0xAX2BtcuvSC/LBCiVAnEIOe7jKZjzya+B9gDvSk4hpfvhPefy5IdQK1mpQ== +vscode-languageserver@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-6.0.1.tgz#4f499d245f1baf83bd607dd79c4c3fd19e8cefc0" + integrity sha512-Wk4I/Dn5KNARWockdCrYuuImJz6bpYG8n2G3Kk5AU6Xy9nWNHD6YjB9/Rd99p4goViZOyETM+hYE81LnEzQZUA== dependencies: - vscode-languageserver-protocol "^3.15.0-next.10" + vscode-languageserver-protocol "^3.15.1" vscode-nls@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c" integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A== -vscode-uri@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.1.0.tgz#475a4269e63edbc13914b40c84bc1416e3398156" - integrity sha512-3voe44nOhb6OdKlpZShVsmVvY2vFQHMe6REP3Ky9RVJuPyM/XidsjH6HncCIDdSmbcF5YQHrTC/Q+Q2loJGkOw== - vscode-uri@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.1.1.tgz#5aa1803391b6ebdd17d047f51365cf62c38f6e90" diff --git a/extensions/json-language-features/yarn.lock b/extensions/json-language-features/yarn.lock index 27e4f7cf883..608f3eaed5b 100644 --- a/extensions/json-language-features/yarn.lock +++ b/extensions/json-language-features/yarn.lock @@ -120,31 +120,31 @@ vscode-extension-telemetry@0.1.1: dependencies: applicationinsights "1.0.8" -vscode-jsonrpc@^5.0.0-next.2: - version "5.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.0-next.2.tgz#a44bc03f67069e53f8d8beb88b96c0cacbfefbca" - integrity sha512-Q3/jabZUNviCG9hhF6hHWjhrABevPF9mv0aiE2j8BYCAP2k+aHTpjMyk+04MzaAqWYwXdQuZkLSbcYCCqbzJLg== +vscode-jsonrpc@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz#9bab9c330d89f43fc8c1e8702b5c36e058a01794" + integrity sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A== -vscode-languageclient@^6.0.0-next.3: - version "6.0.0-next.3" - resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-6.0.0-next.3.tgz#41b701d963fc7affc01e9279532a747fcd4f3810" - integrity sha512-SuSaG9xjqkROm4Ie0jQig0CFDuU/WxHERegl3kRsFHDbhMSK4dH45ZeBY5zMWUgZ+LrIrEbwf8qWNlrTRBlUgg== +vscode-languageclient@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-6.0.1.tgz#acd138e0a19a40c5788365e882ae11c164d9a460" + integrity sha512-7yZaSHichTJEyOJykI2RLQEECf9MqNLoklzC/1OVi/M8ioIsWQ1+lkN1nTsUhd6+F7p9ar9dNmPiEhL0i5uUBA== dependencies: semver "^6.3.0" - vscode-languageserver-protocol "^3.15.0-next.10" + vscode-languageserver-protocol "^3.15.1" -vscode-languageserver-protocol@^3.15.0-next.10: - version "3.15.0-next.10" - resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.10.tgz#f1382f0c270ae5d0c2c7e552483285fb75810914" - integrity sha512-TmbBhKrBoYNX+/pQGwoXmy2qlOfjGBUhwUGIzQoWpj8qtDzYuLof8bi19rGLZ9sVuSHh3anvIyVpGJEqT0QODQ== +vscode-languageserver-protocol@^3.15.1: + version "3.15.1" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.1.tgz#7555e595f0058b9a166f14605ad039e97fab320a" + integrity sha512-wJAo06VM9ZBnRqslplDjfz6Tdive0O7z44yNxBFA3x0/YZkXBIL6I+9rwQ/9Y//0X0eCh12FQrj+KmEXf2L5eA== dependencies: - vscode-jsonrpc "^5.0.0-next.2" - vscode-languageserver-types "^3.15.0-next.6" + vscode-jsonrpc "^5.0.1" + vscode-languageserver-types "3.15.0" -vscode-languageserver-types@^3.15.0-next.6: - version "3.15.0-next.6" - resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.6.tgz#7a990d00c39ad4e744335afb4cc422a3e687ff25" - integrity sha512-+4jfvmZ26oFMSX6EgPRB75PWHoT8pzyWuSSWk0erC4hTzmJq2gWxVLh20bZutZjMmiivawvPshtM3XZhX2SttA== +vscode-languageserver-types@3.15.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0.tgz#c45a23308ec0967135c483b759dfaf97978d9e0a" + integrity sha512-AXteNagMhBWnZ6gNN0UB4HTiD/7TajgfHl6jaM6O7qz3zDJw0H3Jf83w05phihnBRCML+K6Ockh8f8bL0OObPw== vscode-nls@^4.1.1: version "4.1.1" diff --git a/extensions/json/package.json b/extensions/json/package.json index e66955770bc..8f34baf1484 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -67,12 +67,6 @@ "scopeName": "source.json.comments", "path": "./syntaxes/JSONC.tmLanguage.json" } - ], - "jsonValidation": [ - { - "fileMatch": "*.schema.json", - "url": "http://json-schema.org/draft-07/schema#" - } ] } } diff --git a/extensions/json/test/colorize-results/test_json.json b/extensions/json/test/colorize-results/test_json.json index 75561c366d7..fc3dec21721 100644 --- a/extensions/json/test/colorize-results/test_json.json +++ b/extensions/json/test/colorize-results/test_json.json @@ -279,9 +279,9 @@ "t": "source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json constant.numeric.json", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -488,9 +488,9 @@ "t": "source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json constant.numeric.json", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -686,9 +686,9 @@ "t": "source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json constant.numeric.json", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1165,4 +1165,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/less/test/colorize-results/test-cssvariables_less.json b/extensions/less/test/colorize-results/test-cssvariables_less.json index 1c9b8658a0a..41db8bdaf48 100644 --- a/extensions/less/test/colorize-results/test-cssvariables_less.json +++ b/extensions/less/test/colorize-results/test-cssvariables_less.json @@ -103,9 +103,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -114,9 +114,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -202,9 +202,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -422,9 +422,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -521,9 +521,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -532,9 +532,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css meta.function.variable.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -582,4 +582,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/less/test/colorize-results/test_less.json b/extensions/less/test/colorize-results/test_less.json index d6b39257feb..7c48bc0681e 100644 --- a/extensions/less/test/colorize-results/test_less.json +++ b/extensions/less/test/colorize-results/test_less.json @@ -829,9 +829,9 @@ "t": "source.css.less constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -840,9 +840,9 @@ "t": "source.css.less constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1082,9 +1082,9 @@ "t": "source.css.less meta.property-list.css meta.function.color.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1115,9 +1115,9 @@ "t": "source.css.less meta.property-list.css meta.function.color.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1148,9 +1148,9 @@ "t": "source.css.less meta.property-list.css meta.function.color.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1390,9 +1390,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1401,9 +1401,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1544,9 +1544,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1555,9 +1555,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1665,9 +1665,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1687,9 +1687,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1709,9 +1709,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1720,9 +1720,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1764,9 +1764,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1775,9 +1775,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1973,9 +1973,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1984,9 +1984,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2182,9 +2182,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2193,9 +2193,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2435,9 +2435,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-list.css meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2446,9 +2446,9 @@ "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-list.css meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2578,9 +2578,9 @@ "t": "source.css.less constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2589,9 +2589,9 @@ "t": "source.css.less constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2897,9 +2897,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3117,9 +3117,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3458,9 +3458,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3469,9 +3469,9 @@ "t": "source.css.less meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -3508,4 +3508,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/lua/test/colorize-results/test_lua.json b/extensions/lua/test/colorize-results/test_lua.json index 21c3d794e5b..16117e5a94a 100644 --- a/extensions/lua/test/colorize-results/test_lua.json +++ b/extensions/lua/test/colorize-results/test_lua.json @@ -180,9 +180,9 @@ "t": "source.lua constant.numeric.integer.lua", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -246,9 +246,9 @@ "t": "source.lua constant.numeric.integer.lua", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -367,9 +367,9 @@ "t": "source.lua constant.numeric.integer.lua", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -681,4 +681,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/npm/src/features/jsonContributions.ts b/extensions/npm/src/features/jsonContributions.ts index af91f401201..4a255baf823 100644 --- a/extensions/npm/src/features/jsonContributions.ts +++ b/extensions/npm/src/features/jsonContributions.ts @@ -111,7 +111,7 @@ export class JSONCompletionItemProvider implements CompletionItemProvider { add: (suggestion: CompletionItem) => { if (!proposed[suggestion.label]) { proposed[suggestion.label] = true; - suggestion.range2 = { replacing: overwriteRange, inserting: new Range(overwriteRange.start, overwriteRange.start) }; + suggestion.range = { replacing: overwriteRange, inserting: new Range(overwriteRange.start, overwriteRange.start) }; items.push(suggestion); } }, diff --git a/extensions/objective-c/test/colorize-results/test_m.json b/extensions/objective-c/test/colorize-results/test_m.json index 5923e3433da..d0a8eb93dd3 100644 --- a/extensions/objective-c/test/colorize-results/test_m.json +++ b/extensions/objective-c/test/colorize-results/test_m.json @@ -752,9 +752,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1731,9 +1731,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.other.unit.hexadecimal.objc", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1742,9 +1742,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.hexadecimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1819,9 +1819,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1830,9 +1830,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.point.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1841,9 +1841,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1896,9 +1896,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1907,9 +1907,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.point.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1918,9 +1918,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1929,9 +1929,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.other.unit.exponent.decimal.objc", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1940,9 +1940,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.exponent.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1995,9 +1995,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2006,9 +2006,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.point.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2017,9 +2017,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2028,9 +2028,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.other.unit.exponent.decimal.objc", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2039,9 +2039,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.minus.exponent.decimal.objc", "r": { "dark_plus": "keyword.operator.minus.exponent: #B5CEA8", - "light_plus": "keyword.operator.minus.exponent: #09885A", + "light_plus": "keyword.operator.minus.exponent: #098658", "dark_vs": "keyword.operator.minus.exponent: #B5CEA8", - "light_vs": "keyword.operator.minus.exponent: #09885A", + "light_vs": "keyword.operator.minus.exponent: #098658", "hc_black": "keyword.operator: #D4D4D4" } }, @@ -2050,9 +2050,9 @@ "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.exponent.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3090,4 +3090,4 @@ "hc_black": "storage.type: #569CD6" } } -] \ No newline at end of file +] diff --git a/extensions/objective-c/test/colorize-results/test_mm.json b/extensions/objective-c/test/colorize-results/test_mm.json index 6134c33a619..e724c6022ff 100644 --- a/extensions/objective-c/test/colorize-results/test_mm.json +++ b/extensions/objective-c/test/colorize-results/test_mm.json @@ -752,9 +752,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1731,9 +1731,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.other.unit.hexadecimal.objcpp", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1742,9 +1742,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.hexadecimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1819,9 +1819,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1830,9 +1830,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.point.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1841,9 +1841,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1896,9 +1896,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1907,9 +1907,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.point.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1918,9 +1918,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1929,9 +1929,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.other.unit.exponent.decimal.objcpp", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1940,9 +1940,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.exponent.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1995,9 +1995,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2006,9 +2006,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.point.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2017,9 +2017,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2028,9 +2028,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.other.unit.exponent.decimal.objcpp", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2039,9 +2039,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.minus.exponent.decimal.objcpp", "r": { "dark_plus": "keyword.operator.minus.exponent: #B5CEA8", - "light_plus": "keyword.operator.minus.exponent: #09885A", + "light_plus": "keyword.operator.minus.exponent: #098658", "dark_vs": "keyword.operator.minus.exponent: #B5CEA8", - "light_vs": "keyword.operator.minus.exponent: #09885A", + "light_vs": "keyword.operator.minus.exponent: #098658", "hc_black": "keyword.operator: #D4D4D4" } }, @@ -2050,9 +2050,9 @@ "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.exponent.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3090,4 +3090,4 @@ "hc_black": "storage.type: #569CD6" } } -] \ No newline at end of file +] diff --git a/extensions/package.json b/extensions/package.json index 65d512cb8a5..f2f1225c829 100644 --- a/extensions/package.json +++ b/extensions/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "description": "Dependencies shared by all extensions", "dependencies": { - "typescript": "3.7.3" + "typescript": "3.7.5" }, "scripts": { "postinstall": "node ./postinstall" diff --git a/extensions/php/test/colorize-results/test_php.json b/extensions/php/test/colorize-results/test_php.json index 277428ac11b..62c1b712679 100644 --- a/extensions/php/test/colorize-results/test_php.json +++ b/extensions/php/test/colorize-results/test_php.json @@ -1137,9 +1137,9 @@ "t": "text.html.php meta.embedded.block.php source.php constant.numeric.decimal.php", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1225,9 +1225,9 @@ "t": "text.html.php meta.embedded.block.php source.php constant.numeric.decimal.php", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2490,9 +2490,9 @@ "t": "text.html.php meta.embedded.block.php source.php constant.numeric.decimal.php", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2776,9 +2776,9 @@ "t": "text.html.php meta.embedded.block.php source.php constant.numeric.decimal.php", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2864,9 +2864,9 @@ "t": "text.html.php meta.embedded.block.php source.php constant.numeric.decimal.php", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3062,9 +3062,9 @@ "t": "text.html.php meta.embedded.block.php source.php constant.numeric.decimal.php", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3172,9 +3172,9 @@ "t": "text.html.php meta.embedded.block.php source.php constant.numeric.decimal.php", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3629,4 +3629,4 @@ "hc_black": "punctuation.definition.tag: #808080" } } -] \ No newline at end of file +] diff --git a/extensions/powershell/test/colorize-results/test_ps1.json b/extensions/powershell/test/colorize-results/test_ps1.json index 67380ce77b6..d12f004fb9f 100644 --- a/extensions/powershell/test/colorize-results/test_ps1.json +++ b/extensions/powershell/test/colorize-results/test_ps1.json @@ -950,9 +950,9 @@ "t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell meta.attribute.powershell constant.numeric.integer.powershell", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1522,9 +1522,9 @@ "t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell constant.numeric.integer.powershell", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1599,9 +1599,9 @@ "t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell constant.numeric.integer.powershell", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2892,4 +2892,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/pug/test/colorize-results/test_pug.json b/extensions/pug/test/colorize-results/test_pug.json index a022fd80cd0..b23f1fca31f 100644 --- a/extensions/pug/test/colorize-results/test_pug.json +++ b/extensions/pug/test/colorize-results/test_pug.json @@ -158,9 +158,9 @@ "t": "text.pug meta.tag.other attribute_value constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -180,9 +180,9 @@ "t": "text.pug meta.tag.other attribute_value constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -455,9 +455,9 @@ "t": "text.pug meta.tag.other attribute_value constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -477,9 +477,9 @@ "t": "text.pug meta.tag.other attribute_value constant.numeric.decimal.js", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1704,4 +1704,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/python/package.json b/extensions/python/package.json index c500b586f45..1a7a65b2dee 100644 --- a/extensions/python/package.json +++ b/extensions/python/package.json @@ -8,6 +8,7 @@ "engines": { "vscode": "*" }, "activationEvents": ["onLanguage:python"], "main": "./out/pythonMain", + "extensionKind": [ "ui", "workspace" ], "contributes": { "languages": [{ "id": "python", diff --git a/extensions/python/test/colorize-results/test_py.json b/extensions/python/test/colorize-results/test_py.json index 2c312658625..c61d2db7611 100644 --- a/extensions/python/test/colorize-results/test_py.json +++ b/extensions/python/test/colorize-results/test_py.json @@ -169,9 +169,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -565,9 +565,9 @@ "t": "source.python meta.function-call.python meta.function-call.arguments.python constant.numeric.float.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1137,9 +1137,9 @@ "t": "source.python meta.function.python meta.function.parameters.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1214,9 +1214,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1280,9 +1280,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1324,9 +1324,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1390,9 +1390,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1456,9 +1456,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1522,9 +1522,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1566,9 +1566,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1632,9 +1632,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1698,9 +1698,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1764,9 +1764,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1808,9 +1808,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1874,9 +1874,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1962,9 +1962,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2424,9 +2424,9 @@ "t": "source.python meta.function-call.python meta.function-call.arguments.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2446,9 +2446,9 @@ "t": "source.python meta.function-call.python meta.function-call.arguments.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2468,9 +2468,9 @@ "t": "source.python meta.function-call.python meta.function-call.arguments.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2490,9 +2490,9 @@ "t": "source.python meta.function-call.python meta.function-call.arguments.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2985,9 +2985,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3359,9 +3359,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3414,9 +3414,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3480,9 +3480,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3568,9 +3568,9 @@ "t": "source.python constant.numeric.float.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3601,9 +3601,9 @@ "t": "source.python constant.numeric.float.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3656,9 +3656,9 @@ "t": "source.python constant.numeric.float.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3722,9 +3722,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3854,9 +3854,9 @@ "t": "source.python constant.numeric.float.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3898,9 +3898,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6252,9 +6252,9 @@ "t": "source.python constant.numeric.dec.python", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6797,4 +6797,4 @@ "hc_black": "string: #CE9178" } } -] \ No newline at end of file +] diff --git a/extensions/r/test/colorize-results/test_r.json b/extensions/r/test/colorize-results/test_r.json index 2cba70d079b..2d3e504f8de 100644 --- a/extensions/r/test/colorize-results/test_r.json +++ b/extensions/r/test/colorize-results/test_r.json @@ -554,9 +554,9 @@ "t": "source.r meta.function-call.r meta.function-call.arguments.r constant.numeric.float.decimal.r", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -598,9 +598,9 @@ "t": "source.r meta.function-call.r meta.function-call.arguments.r constant.numeric.float.decimal.r", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -631,9 +631,9 @@ "t": "source.r meta.function-call.r meta.function-call.arguments.r constant.numeric.float.decimal.r", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -675,9 +675,9 @@ "t": "source.r meta.function-call.r meta.function-call.arguments.r constant.numeric.float.decimal.r", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -708,9 +708,9 @@ "t": "source.r meta.function-call.r meta.function-call.arguments.r constant.numeric.float.decimal.r", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1044,4 +1044,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/razor/test/colorize-results/test_cshtml.json b/extensions/razor/test/colorize-results/test_cshtml.json index 37e1a3d66d1..e542974ce42 100644 --- a/extensions/razor/test/colorize-results/test_cshtml.json +++ b/extensions/razor/test/colorize-results/test_cshtml.json @@ -92,9 +92,9 @@ "t": "text.html.cshtml constant.numeric.decimal.cs", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3695,4 +3695,4 @@ "hc_black": "punctuation.definition.tag: #808080" } } -] \ No newline at end of file +] diff --git a/extensions/ruby/test/colorize-results/test_rb.json b/extensions/ruby/test/colorize-results/test_rb.json index c53ee5970e2..66468920c99 100644 --- a/extensions/ruby/test/colorize-results/test_rb.json +++ b/extensions/ruby/test/colorize-results/test_rb.json @@ -2017,9 +2017,9 @@ "t": "source.ruby constant.numeric.integer.ruby", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2666,9 +2666,9 @@ "t": "source.ruby constant.numeric.integer.ruby", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2837,4 +2837,4 @@ "hc_black": "keyword.control: #C586C0" } } -] \ No newline at end of file +] diff --git a/extensions/scss/test/colorize-results/test-cssvariables_scss.json b/extensions/scss/test/colorize-results/test-cssvariables_scss.json index e51a05d345f..c2862cddcb8 100644 --- a/extensions/scss/test/colorize-results/test-cssvariables_scss.json +++ b/extensions/scss/test/colorize-results/test-cssvariables_scss.json @@ -92,9 +92,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -103,9 +103,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -180,9 +180,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -400,9 +400,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -499,9 +499,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -510,9 +510,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -549,4 +549,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/scss/test/colorize-results/test_scss.json b/extensions/scss/test/colorize-results/test_scss.json index 25154050795..a95d72d9e16 100644 --- a/extensions/scss/test/colorize-results/test_scss.json +++ b/extensions/scss/test/colorize-results/test_scss.json @@ -290,9 +290,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -301,9 +301,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -433,9 +433,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -444,9 +444,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -708,9 +708,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -719,9 +719,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1335,9 +1335,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1346,9 +1346,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1368,9 +1368,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1379,9 +1379,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1500,9 +1500,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1511,9 +1511,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -1874,9 +1874,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1962,9 +1962,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1973,9 +1973,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -2182,9 +2182,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2303,9 +2303,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2886,9 +2886,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2897,9 +2897,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -3106,9 +3106,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3117,9 +3117,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -3249,9 +3249,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3260,9 +3260,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -3326,9 +3326,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3337,9 +3337,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -3909,9 +3909,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3942,9 +3942,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3975,9 +3975,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4008,9 +4008,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4184,9 +4184,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4195,9 +4195,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4239,9 +4239,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4250,9 +4250,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4305,9 +4305,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4624,9 +4624,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4635,9 +4635,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4679,9 +4679,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4690,9 +4690,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -4811,9 +4811,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss string.quoted.double.scss variable.interpolation.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4855,9 +4855,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss string.quoted.double.scss variable.interpolation.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -4976,9 +4976,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5009,9 +5009,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5020,9 +5020,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5053,9 +5053,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5064,9 +5064,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5196,9 +5196,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5262,9 +5262,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5273,9 +5273,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5339,9 +5339,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5350,9 +5350,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5460,9 +5460,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5471,9 +5471,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5526,9 +5526,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5537,9 +5537,9 @@ "t": "source.css.scss meta.definition.variable.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -5845,9 +5845,9 @@ "t": "source.css.scss meta.property-list.scss meta.at-rule.return.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6043,9 +6043,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6769,9 +6769,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6780,9 +6780,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7022,9 +7022,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7033,9 +7033,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7209,9 +7209,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7220,9 +7220,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7528,9 +7528,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7539,9 +7539,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -7825,9 +7825,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7836,9 +7836,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -8507,9 +8507,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8518,9 +8518,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -8892,9 +8892,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8903,9 +8903,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -9343,9 +9343,9 @@ "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9387,9 +9387,9 @@ "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9431,9 +9431,9 @@ "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9508,9 +9508,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9519,9 +9519,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -9629,9 +9629,9 @@ "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9673,9 +9673,9 @@ "t": "source.css.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9750,9 +9750,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9761,9 +9761,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -9926,9 +9926,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9937,9 +9937,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -10564,9 +10564,9 @@ "t": "source.css.scss meta.at-rule.for.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -10608,9 +10608,9 @@ "t": "source.css.scss meta.at-rule.for.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -10773,9 +10773,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -10784,9 +10784,9 @@ "t": "source.css.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -11367,9 +11367,9 @@ "t": "source.css.scss meta.at-rule.each.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -11466,9 +11466,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -11631,9 +11631,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -11642,9 +11642,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.em.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -11818,9 +11818,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -12104,9 +12104,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.for.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -12456,9 +12456,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.if.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -12544,9 +12544,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -12555,9 +12555,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.percentage.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -13039,9 +13039,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -13050,9 +13050,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -13402,9 +13402,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -13413,9 +13413,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -13589,9 +13589,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.at-rule.mixin.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -13600,9 +13600,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.at-rule.mixin.scss constant.numeric.css keyword.other.unit.in.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -14535,9 +14535,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -14546,9 +14546,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -14568,9 +14568,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -14579,9 +14579,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -14601,9 +14601,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -14612,9 +14612,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -14667,9 +14667,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -14678,9 +14678,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -14700,9 +14700,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -14711,9 +14711,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -14733,9 +14733,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -14744,9 +14744,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.include.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -16559,9 +16559,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -16570,9 +16570,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.cm.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -16636,9 +16636,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -16647,9 +16647,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.cm.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -16878,9 +16878,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -16889,9 +16889,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -17483,9 +17483,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.at-rule.extend.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -17604,9 +17604,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -18066,9 +18066,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -18077,9 +18077,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -18187,9 +18187,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -18198,9 +18198,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css keyword.other.unit.px.css", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", - "light_plus": "keyword.other.unit: #09885A", + "light_plus": "keyword.other.unit: #098658", "dark_vs": "keyword.other.unit: #B5CEA8", - "light_vs": "keyword.other.unit: #09885A", + "light_vs": "keyword.other.unit: #098658", "hc_black": "keyword.other.unit: #B5CEA8" } }, @@ -18880,9 +18880,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -18979,9 +18979,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -19111,9 +19111,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -19221,9 +19221,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -19419,9 +19419,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -19551,9 +19551,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -19738,9 +19738,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -19870,9 +19870,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -20057,9 +20057,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -20167,9 +20167,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.property-list.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -20376,9 +20376,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -20508,9 +20508,9 @@ "t": "source.css.scss meta.at-rule.each.scss meta.at-rule.while.scss meta.property-list.scss meta.at-rule.keyframes.scss meta.property-list.scss meta.property-value.scss constant.numeric.css", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -21020,4 +21020,4 @@ "hc_black": "comment: #7CA668" } } -] \ No newline at end of file +] diff --git a/extensions/search-result/package.json b/extensions/search-result/package.json index 40d59e2bcd7..6a55968bda1 100644 --- a/extensions/search-result/package.json +++ b/extensions/search-result/package.json @@ -25,46 +25,6 @@ "editor.lineNumbers": "off" } }, - "commands": [ - { - "command": "searchResult.rerunSearch", - "title": "%searchResult.rerunSearch.title%", - "category": "Search Result", - "icon": { - "light": "./src/media/refresh-light.svg", - "dark": "./src/media/refresh-dark.svg" - } - }, - { - "command": "searchResult.rerunSearchWithContext", - "title": "%searchResult.rerunSearchWithContext.title%", - "category": "Search Result", - "icon": { - "light": "./src/media/refresh-light.svg", - "dark": "./src/media/refresh-dark.svg" - } - } - ], - "menus": { - "commandPalette": [ - { - "command": "searchResult.rerunSearch", - "when": "false" - }, - { - "command": "searchResult.rerunSearchWithContext", - "when": "false" - } - ], - "editor/title": [ - { - "command": "searchResult.rerunSearch", - "when": "editorLangId == search-result", - "alt": "searchResult.rerunSearchWithContext", - "group": "navigation" - } - ] - }, "languages": [ { "id": "search-result", diff --git a/extensions/search-result/package.nls.json b/extensions/search-result/package.nls.json index ce90d23c09c..324fd97bcd2 100644 --- a/extensions/search-result/package.nls.json +++ b/extensions/search-result/package.nls.json @@ -1,6 +1,4 @@ { "displayName": "Search Result", - "description": "Provides syntax highlighting and language features for tabbed search results.", - "searchResult.rerunSearch.title": "Search Again", - "searchResult.rerunSearchWithContext.title": "Search Again (With Context)" + "description": "Provides syntax highlighting and language features for tabbed search results." } diff --git a/extensions/search-result/src/extension.ts b/extensions/search-result/src/extension.ts index 0bd5e12188e..f7453a45d19 100644 --- a/extensions/search-result/src/extension.ts +++ b/extensions/search-result/src/extension.ts @@ -34,8 +34,6 @@ export function activate(context: vscode.ExtensionContext) { } context.subscriptions.push( - vscode.commands.registerCommand('searchResult.rerunSearch', () => vscode.commands.executeCommand('search.action.rerunEditorSearch')), - vscode.commands.registerCommand('searchResult.rerunSearchWithContext', () => vscode.commands.executeCommand('search.action.rerunEditorSearchWithContext')), vscode.languages.registerDocumentSymbolProvider(SEARCH_RESULT_SELECTOR, { provideDocumentSymbols(document: vscode.TextDocument, token: vscode.CancellationToken): vscode.DocumentSymbol[] { diff --git a/extensions/shaderlab/test/colorize-results/test_shader.json b/extensions/shaderlab/test/colorize-results/test_shader.json index 7f731af089f..80eff76e153 100644 --- a/extensions/shaderlab/test/colorize-results/test_shader.json +++ b/extensions/shaderlab/test/colorize-results/test_shader.json @@ -455,9 +455,9 @@ "t": "source.shaderlab meta.cgblock constant.numeric.hlsl", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -571,4 +571,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/sql/test/colorize-results/test_sql.json b/extensions/sql/test/colorize-results/test_sql.json index da116cea9c3..4bc7ff28152 100644 --- a/extensions/sql/test/colorize-results/test_sql.json +++ b/extensions/sql/test/colorize-results/test_sql.json @@ -136,9 +136,9 @@ "t": "source.sql constant.numeric.sql", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -180,9 +180,9 @@ "t": "source.sql constant.numeric.sql", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -213,9 +213,9 @@ "t": "source.sql constant.numeric.sql", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -268,9 +268,9 @@ "t": "source.sql constant.numeric.sql", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -290,9 +290,9 @@ "t": "source.sql constant.numeric.sql", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -318,4 +318,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/swift/test/colorize-results/test_swift.json b/extensions/swift/test/colorize-results/test_swift.json index 8512da234c9..977818bdec7 100644 --- a/extensions/swift/test/colorize-results/test_swift.json +++ b/extensions/swift/test/colorize-results/test_swift.json @@ -48,9 +48,9 @@ "t": "source.swift constant.numeric.integer.decimal.swift", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -802,4 +802,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/theme-defaults/themes/light_vs.json b/extensions/theme-defaults/themes/light_vs.json index 5453787c4ed..cbf19b22988 100644 --- a/extensions/theme-defaults/themes/light_vs.json +++ b/extensions/theme-defaults/themes/light_vs.json @@ -51,7 +51,7 @@ "keyword.operator.minus.exponent" ], "settings": { - "foreground": "#09885a" + "foreground": "#098658" } }, { @@ -130,7 +130,7 @@ { "scope": "markup.inserted", "settings": { - "foreground": "#09885a" + "foreground": "#098658" } }, { @@ -185,7 +185,7 @@ { "scope": "meta.preprocessor.numeric", "settings": { - "foreground": "#09885a" + "foreground": "#098658" } }, { @@ -346,7 +346,7 @@ { "scope": "keyword.other.unit", "settings": { - "foreground": "#09885a" + "foreground": "#098658" } }, { @@ -367,7 +367,7 @@ { "scope": "constant.sha.git-rebase", "settings": { - "foreground": "#09885a" + "foreground": "#098658" } }, { diff --git a/extensions/typescript-basics/cgmanifest.json b/extensions/typescript-basics/cgmanifest.json index 31f2e0c545a..4136543a84f 100644 --- a/extensions/typescript-basics/cgmanifest.json +++ b/extensions/typescript-basics/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "TypeScript-TmLanguage", "repositoryUrl": "https://github.com/Microsoft/TypeScript-TmLanguage", - "commitHash": "b7ef0941e38d56292d19ee7706a558dbff6c3a35" + "commitHash": "f065e7e88d1c20160c5ec92455aad99a1016284f" } }, "license": "MIT", diff --git a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json index 437e205163f..4edc3b8285e 100644 --- a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScript.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/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f065e7e88d1c20160c5ec92455aad99a1016284f", "name": "TypeScript", "scopeName": "source.ts", "patterns": [ @@ -1078,13 +1078,13 @@ }, "field-declaration": { "name": "meta.field.declaration.ts", - "begin": "(?x)(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(\\#?[_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.ts entity.name.function.ts" @@ -1120,7 +1120,7 @@ }, { "name": "meta.definition.property.ts variable.object.property.ts", - "match": "[_$[:alpha:]][_$[:alnum:]]*" + "match": "\\#?[_$[:alpha:]][_$[:alnum:]]*" }, { "name": "keyword.operator.optional.ts", @@ -1995,7 +1995,7 @@ "patterns": [ { "name": "meta.import-equals.external.ts", - "begin": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", - "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { "name": "meta.function-call.ts", - "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))", "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { @@ -2831,7 +2846,7 @@ }, { "name": "entity.name.function.ts", - "match": "([_$[:alpha:]][_$[:alnum:]]*)" + "match": "(\\#?[_$[:alpha:]][_$[:alnum:]]*)" } ] }, @@ -3675,7 +3690,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "captures": { "1": { "name": "punctuation.accessor.ts" @@ -3689,7 +3704,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.ts" @@ -3719,7 +3734,7 @@ "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))" }, { - "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.ts" @@ -3736,7 +3751,7 @@ } }, { - "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "variable.other.constant.object.ts" diff --git a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json index c2c6c09a5a2..810cac1b2db 100644 --- a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScriptReact.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/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/f065e7e88d1c20160c5ec92455aad99a1016284f", "name": "TypeScriptReact", "scopeName": "source.tsx", "patterns": [ @@ -1081,13 +1081,13 @@ }, "field-declaration": { "name": "meta.field.declaration.tsx", - "begin": "(?x)(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + "match": "(?x)(\\#?[_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", "captures": { "1": { "name": "meta.definition.property.tsx entity.name.function.tsx" @@ -1123,7 +1123,7 @@ }, { "name": "meta.definition.property.tsx variable.object.property.tsx", - "match": "[_$[:alpha:]][_$[:alnum:]]*" + "match": "\\#?[_$[:alpha:]][_$[:alnum:]]*" }, { "name": "keyword.operator.optional.tsx", @@ -1998,7 +1998,7 @@ "patterns": [ { "name": "meta.import-equals.external.tsx", - "begin": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", - "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", + "end": "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { "name": "meta.function-call.tsx", - "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))", + "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))", "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\()", "patterns": [ { @@ -2834,7 +2849,7 @@ }, { "name": "entity.name.function.tsx", - "match": "([_$[:alpha:]][_$[:alnum:]]*)" + "match": "(\\#?[_$[:alpha:]][_$[:alnum:]]*)" } ] }, @@ -3626,7 +3641,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])", "captures": { "1": { "name": "punctuation.accessor.tsx" @@ -3640,7 +3655,7 @@ } }, { - "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.tsx" @@ -3670,7 +3685,7 @@ "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))" }, { - "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "punctuation.accessor.tsx" @@ -3687,7 +3702,7 @@ } }, { - "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)", + "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)", "captures": { "1": { "name": "variable.other.constant.object.tsx" diff --git a/extensions/typescript-basics/test/colorize-results/test-issue11_ts.json b/extensions/typescript-basics/test/colorize-results/test-issue11_ts.json index 379ac403ce6..d1146aa1288 100644 --- a/extensions/typescript-basics/test/colorize-results/test-issue11_ts.json +++ b/extensions/typescript-basics/test/colorize-results/test-issue11_ts.json @@ -70,9 +70,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -180,9 +180,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -257,9 +257,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -323,9 +323,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -444,9 +444,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -499,9 +499,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -664,9 +664,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -719,9 +719,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -884,9 +884,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -939,9 +939,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1104,9 +1104,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1236,9 +1236,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1269,9 +1269,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1335,9 +1335,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1401,9 +1401,9 @@ "t": "source.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1544,9 +1544,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1566,9 +1566,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1599,9 +1599,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1621,9 +1621,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1643,9 +1643,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1665,9 +1665,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2424,9 +2424,9 @@ "t": "source.ts meta.function.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3007,9 +3007,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3062,9 +3062,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3106,9 +3106,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3150,9 +3150,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3194,9 +3194,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3293,9 +3293,9 @@ "t": "source.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -3398,4 +3398,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/typescript-basics/test/colorize-results/test-members_ts.json b/extensions/typescript-basics/test/colorize-results/test-members_ts.json index 04519a1105b..d1b7974ed66 100644 --- a/extensions/typescript-basics/test/colorize-results/test-members_ts.json +++ b/extensions/typescript-basics/test/colorize-results/test-members_ts.json @@ -213,9 +213,9 @@ "t": "source.ts meta.class.ts meta.field.declaration.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -406,4 +406,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/typescript-basics/test/colorize-results/test-object-literals_ts.json b/extensions/typescript-basics/test/colorize-results/test-object-literals_ts.json index 1b5123075e0..e6b11cc8d3a 100644 --- a/extensions/typescript-basics/test/colorize-results/test-object-literals_ts.json +++ b/extensions/typescript-basics/test/colorize-results/test-object-literals_ts.json @@ -246,9 +246,9 @@ "t": "source.ts meta.var.expr.ts meta.objectliteral.ts meta.object.member.ts meta.objectliteral.ts meta.object.member.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -296,4 +296,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/typescript-basics/test/colorize-results/test-this_ts.json b/extensions/typescript-basics/test/colorize-results/test-this_ts.json index bb626c7e100..e80931da2c0 100644 --- a/extensions/typescript-basics/test/colorize-results/test-this_ts.json +++ b/extensions/typescript-basics/test/colorize-results/test-this_ts.json @@ -92,9 +92,9 @@ "t": "source.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -120,4 +120,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/typescript-basics/test/colorize-results/test_ts.json b/extensions/typescript-basics/test/colorize-results/test_ts.json index 4a2773591c7..053f9a7775d 100644 --- a/extensions/typescript-basics/test/colorize-results/test_ts.json +++ b/extensions/typescript-basics/test/colorize-results/test_ts.json @@ -2039,9 +2039,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2138,9 +2138,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2600,9 +2600,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2611,9 +2611,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts meta.delimiter.decimal.period.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2622,9 +2622,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2721,9 +2721,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -2820,9 +2820,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5416,9 +5416,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5504,9 +5504,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -5724,9 +5724,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6142,9 +6142,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6274,9 +6274,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6340,9 +6340,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6538,9 +6538,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6615,9 +6615,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6780,9 +6780,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -6868,9 +6868,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7693,9 +7693,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -7781,9 +7781,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8551,9 +8551,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -8936,9 +8936,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.block.ts meta.var.expr.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -9805,9 +9805,9 @@ "t": "source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts constant.numeric.decimal.ts", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -11417,4 +11417,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] diff --git a/extensions/typescript-language-features/extension.webpack.config.js b/extensions/typescript-language-features/extension.webpack.config.js index de88398eca0..b8f77666761 100644 --- a/extensions/typescript-language-features/extension.webpack.config.js +++ b/extensions/typescript-language-features/extension.webpack.config.js @@ -14,6 +14,9 @@ module.exports = withDefaults({ resolve: { mainFields: ['module', 'main'] }, + externals: { + 'typescript-vscode-sh-plugin': 'commonjs vscode' // used by build/lib/extensions to know what node_modules to bundle + }, entry: { extension: './src/extension.ts', } diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 577a4fd1686..a964fcfb712 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -19,14 +19,15 @@ "jsonc-parser": "^2.1.1", "rimraf": "^2.6.3", "semver": "5.5.1", + "typescript-vscode-sh-plugin": "^0.6.4", "vscode-extension-telemetry": "0.1.1", "vscode-nls": "^4.0.0" }, "devDependencies": { "@types/node": "^12.11.7", - "@types/semver": "^5.5.0", "@types/rimraf": "2.0.2", - "vscode": "^1.1.10" + "@types/semver": "^5.5.0", + "vscode": "^1.1.36" }, "scripts": { "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:typescript ./tsconfig.json" @@ -953,6 +954,12 @@ } ] } + ], + "typescriptServerPlugins": [ + { + "name": "typescript-vscode-sh-plugin", + "enableForWorkspaceTypeScriptVersions": true + } ] } } diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts index cd887f1f4aa..e0e9e558886 100644 --- a/extensions/typescript-language-features/src/features/completions.ts +++ b/extensions/typescript-language-features/src/features/completions.ts @@ -23,6 +23,8 @@ import FileConfigurationManager from './fileConfigurationManager'; const localize = nls.loadMessageBundle(); +const knownTsTriggerCharacters = new Set(['.', '"', '\'', '`', '/', '@', '<']); + interface DotAccessorContext { readonly range: vscode.Range; readonly text: string; @@ -331,7 +333,7 @@ namespace CompletionConfiguration { class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider { - public static readonly triggerCharacters = ['.', '"', '\'', '`', '/', '@', '<']; + public static readonly triggerCharacters = ['.', '"', '\'', '`', '/', '@', '<', '#']; constructor( private readonly client: ITypeScriptServiceClient, @@ -466,6 +468,10 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider return undefined; } + if (context.triggerCharacter && !knownTsTriggerCharacters.has(context.triggerCharacter)) { + return undefined; + } + return context.triggerCharacter as Proto.CompletionsTriggerCharacter; } @@ -512,7 +518,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider } item.additionalTextEdits = codeAction.additionalTextEdits; - if (detail && item.useCodeSnippet) { + if (item.useCodeSnippet) { const shouldCompleteFunction = await this.isValidFunctionCompletionContext(filepath, item.position, item.document, token); if (shouldCompleteFunction) { const { snippet, parameterCount } = snippetForFunctionCall(item, detail.displayParts); @@ -594,7 +600,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider ): boolean { if (this.client.apiVersion.lt(API.v320)) { // Workaround for https://github.com/Microsoft/TypeScript/issues/27742 - // Only enable dot completions when previous character not a dot preceeded by whitespace. + // Only enable dot completions when previous character not a dot preceded by whitespace. // Prevents incorrectly completing while typing spread operators. if (position.character > 1) { const preText = document.getText(new vscode.Range( diff --git a/extensions/typescript-language-features/src/features/formatting.ts b/extensions/typescript-language-features/src/features/formatting.ts index d64effd1a32..3caedf86f82 100644 --- a/extensions/typescript-language-features/src/features/formatting.ts +++ b/extensions/typescript-language-features/src/features/formatting.ts @@ -60,12 +60,9 @@ class TypeScriptFormattingProvider implements vscode.DocumentRangeFormattingEdit if (response.type !== 'response' || !response.body) { return []; } - const edits = response.body; + const result: vscode.TextEdit[] = []; - if (!edits) { - return result; - } - for (const edit of edits) { + for (const edit of response.body) { const textEdit = typeConverters.TextEdit.fromCodeEdit(edit); const range = textEdit.range; // Work around for https://github.com/Microsoft/TypeScript/issues/6700. @@ -99,4 +96,4 @@ export function register( vscode.languages.registerDocumentRangeFormattingEditProvider(selector, formattingProvider), ); }); -} \ No newline at end of file +} diff --git a/extensions/typescript-language-features/src/features/jsDocCompletions.ts b/extensions/typescript-language-features/src/features/jsDocCompletions.ts index d4d59c8d6d5..03feee6a334 100644 --- a/extensions/typescript-language-features/src/features/jsDocCompletions.ts +++ b/extensions/typescript-language-features/src/features/jsDocCompletions.ts @@ -28,7 +28,7 @@ class JsDocCompletionItem extends vscode.CompletionItem { const suffix = line.slice(position.character).match(/^\s*\**\//); const start = position.translate(0, prefix ? -prefix[0].length : 0); const range = new vscode.Range(start, position.translate(0, suffix ? suffix[0].length : 0)); - this.range2 = { inserting: range, replacing: range }; + this.range = { inserting: range, replacing: range }; } } diff --git a/extensions/typescript-language-features/src/features/refactor.ts b/extensions/typescript-language-features/src/features/refactor.ts index 017ea358b2a..c866665f041 100644 --- a/extensions/typescript-language-features/src/features/refactor.ts +++ b/extensions/typescript-language-features/src/features/refactor.ts @@ -313,11 +313,26 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { private appendInvalidActions(actions: vscode.CodeAction[]): vscode.CodeAction[] { if (!actions.some(action => action.kind && Extract_Constant.kind.contains(action.kind))) { - const disabledAction = new vscode.CodeAction('Extract to constant', Extract_Constant.kind); + const disabledAction = new vscode.CodeAction( + localize('extractConstant.disabled.title', "Extract to constant"), + Extract_Constant.kind); + disabledAction.disabled = { - reason: localize('extract.disabled', "The current selection cannot be extracted"), + reason: localize('extractConstant.disabled.reason', "The current selection cannot be extracted"), }; disabledAction.isPreferred = true; + + actions.push(disabledAction); + } + + if (!actions.some(action => action.kind && Extract_Function.kind.contains(action.kind))) { + const disabledAction = new vscode.CodeAction( + localize('extractFunction.disabled.title', "Extract to function"), + Extract_Function.kind); + + disabledAction.disabled = { + reason: localize('extractFunction.disabled.reason', "The current selection cannot be extracted"), + }; actions.push(disabledAction); } return actions; diff --git a/extensions/typescript-language-features/src/features/semanticTokens.ts b/extensions/typescript-language-features/src/features/semanticTokens.ts new file mode 100644 index 00000000000..3c3aff06202 --- /dev/null +++ b/extensions/typescript-language-features/src/features/semanticTokens.ts @@ -0,0 +1,245 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { ITypeScriptServiceClient, ExecConfig, ServerResponse } from '../typescriptService'; +import * as Proto from '../protocol'; +import { VersionDependentRegistration } from '../utils/dependentRegistration'; +import API from '../utils/api'; + +// all constants are const +import { TokenType, TokenModifier, TokenEncodingConsts, VersionRequirement } from 'typescript-vscode-sh-plugin/lib/constants'; + +const minTypeScriptVersion = API.fromVersionString(`${VersionRequirement.major}.${VersionRequirement.minor}`); + +export function register(selector: vscode.DocumentSelector, client: ITypeScriptServiceClient) { + return new VersionDependentRegistration(client, minTypeScriptVersion, () => { + const provider = new DocumentSemanticTokensProvider(client); + return vscode.Disposable.from( + vscode.languages.registerDocumentSemanticTokensProvider(selector, provider, provider.getLegend()), + vscode.languages.registerDocumentRangeSemanticTokensProvider(selector, provider, provider.getLegend()), + ); + }); +} + +/** + * Prototype of a DocumentSemanticTokensProvider, relying on the experimental `encodedSemanticClassifications-full` request from the TypeScript server. + * As the results retured by the TypeScript server are limited, we also add a Typescript plugin (typescript-vscode-sh-plugin) to enrich the returned token. + * See https://github.com/aeschli/typescript-vscode-sh-plugin. + */ +class DocumentSemanticTokensProvider implements vscode.DocumentSemanticTokensProvider, vscode.DocumentRangeSemanticTokensProvider { + + constructor(private readonly client: ITypeScriptServiceClient) { + } + + getLegend(): vscode.SemanticTokensLegend { + if (tokenTypes.length !== TokenType._) { + console.warn('typescript-vscode-sh-plugin has added new tokens types.'); + } + if (tokenModifiers.length !== TokenModifier._) { + console.warn('typescript-vscode-sh-plugin has added new tokens modifiers.'); + } + return new vscode.SemanticTokensLegend(tokenTypes, tokenModifiers); + } + + async provideDocumentSemanticTokens(document: vscode.TextDocument, token: vscode.CancellationToken): Promise { + const file = this.client.toOpenedFilePath(document); + if (!file) { + return null; + } + return this._provideSemanticTokens(document, { file, start: 0, length: document.getText().length }, token); + } + + async provideDocumentRangeSemanticTokens(document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken): Promise { + const file = this.client.toOpenedFilePath(document); + if (!file) { + return null; + } + const start = document.offsetAt(range.start); + const length = document.offsetAt(range.end) - start; + return this._provideSemanticTokens(document, { file, start, length }, token); + } + + async _provideSemanticTokens(document: vscode.TextDocument, requestArg: ExperimentalProtocol.EncodedSemanticClassificationsRequestArgs, token: vscode.CancellationToken): Promise { + const file = this.client.toOpenedFilePath(document); + if (!file) { + return null; + } + + const versionBeforeRequest = document.version; + + const response = await (this.client as ExperimentalProtocol.IExtendedTypeScriptServiceClient).execute('encodedSemanticClassifications-full', requestArg, token); + if (response.type !== 'response' || !response.body) { + return null; + } + + const versionAfterRequest = document.version; + + if (versionBeforeRequest !== versionAfterRequest) { + // cannot convert result's offsets to (line;col) values correctly + // a new request will come in soon... + return null; + } + + const tokenSpan = response.body.spans; + + const builder = new vscode.SemanticTokensBuilder(); + let i = 0; + while (i < tokenSpan.length) { + const offset = tokenSpan[i++]; + const length = tokenSpan[i++]; + const tsClassification = tokenSpan[i++]; + + let tokenModifiers = 0; + let tokenType = getTokenTypeFromClassification(tsClassification); + if (tokenType !== undefined) { + // it's a classification as returned by the typescript-vscode-sh-plugin + tokenModifiers = getTokenModifierFromClassification(tsClassification); + } else { + // typescript-vscode-sh-plugin is not present + tokenType = tokenTypeMap[tsClassification]; + if (tokenType === undefined) { + continue; + } + } + + // we can use the document's range conversion methods because the result is at the same version as the document + const startPos = document.positionAt(offset); + const endPos = document.positionAt(offset + length); + + for (let line = startPos.line; line <= endPos.line; line++) { + const startCharacter = (line === startPos.line ? startPos.character : 0); + const endCharacter = (line === endPos.line ? endPos.character : document.lineAt(line).text.length); + builder.push(line, startCharacter, endCharacter - startCharacter, tokenType, tokenModifiers); + } + } + return new vscode.SemanticTokens(builder.build()); + } +} + +// typescript-vscode-sh-plugin encodes type and modifiers in the classification: +// TSClassification = (TokenType + 1) << 8 + TokenModifier + +function getTokenTypeFromClassification(tsClassification: number): number | undefined { + if (tsClassification > TokenEncodingConsts.modifierMask) { + return (tsClassification >> TokenEncodingConsts.typeOffset) - 1; + } + return undefined; +} + +function getTokenModifierFromClassification(tsClassification: number) { + return tsClassification & TokenEncodingConsts.modifierMask; +} + +const tokenTypes: string[] = []; +tokenTypes[TokenType.class] = 'class'; +tokenTypes[TokenType.enum] = 'enum'; +tokenTypes[TokenType.interface] = 'interface'; +tokenTypes[TokenType.namespace] = 'namespace'; +tokenTypes[TokenType.typeParameter] = 'typeParameter'; +tokenTypes[TokenType.type] = 'type'; +tokenTypes[TokenType.parameter] = 'parameter'; +tokenTypes[TokenType.variable] = 'variable'; +tokenTypes[TokenType.property] = 'property'; +tokenTypes[TokenType.function] = 'function'; +tokenTypes[TokenType.member] = 'member'; + +const tokenModifiers: string[] = []; +tokenModifiers[TokenModifier.async] = 'async'; +tokenModifiers[TokenModifier.declaration] = 'declaration'; +tokenModifiers[TokenModifier.readonly] = 'readonly'; +tokenModifiers[TokenModifier.static] = 'static'; + +// mapping for the original ExperimentalProtocol.ClassificationType from TypeScript (only used when plugin is not available) +const tokenTypeMap: number[] = []; +tokenTypeMap[ExperimentalProtocol.ClassificationType.className] = TokenType.class; +tokenTypeMap[ExperimentalProtocol.ClassificationType.enumName] = TokenType.enum; +tokenTypeMap[ExperimentalProtocol.ClassificationType.interfaceName] = TokenType.interface; +tokenTypeMap[ExperimentalProtocol.ClassificationType.moduleName] = TokenType.namespace; +tokenTypeMap[ExperimentalProtocol.ClassificationType.typeParameterName] = TokenType.typeParameter; +tokenTypeMap[ExperimentalProtocol.ClassificationType.typeAliasName] = TokenType.type; +tokenTypeMap[ExperimentalProtocol.ClassificationType.parameterName] = TokenType.parameter; + +namespace ExperimentalProtocol { + + export interface IExtendedTypeScriptServiceClient { + execute( + command: K, + args: ExperimentalProtocol.ExtendedTsServerRequests[K][0], + token: vscode.CancellationToken, + config?: ExecConfig + ): Promise>; + } + + /** + * A request to get encoded semantic classifications for a span in the file + */ + export interface EncodedSemanticClassificationsRequest extends Proto.FileRequest { + arguments: EncodedSemanticClassificationsRequestArgs; + } + + /** + * Arguments for EncodedSemanticClassificationsRequest request. + */ + export interface EncodedSemanticClassificationsRequestArgs extends Proto.FileRequestArgs { + /** + * Start position of the span. + */ + start: number; + /** + * Length of the span. + */ + length: number; + } + + export const enum EndOfLineState { + None, + InMultiLineCommentTrivia, + InSingleQuoteStringLiteral, + InDoubleQuoteStringLiteral, + InTemplateHeadOrNoSubstitutionTemplate, + InTemplateMiddleOrTail, + InTemplateSubstitutionPosition, + } + + export const enum ClassificationType { + comment = 1, + identifier = 2, + keyword = 3, + numericLiteral = 4, + operator = 5, + stringLiteral = 6, + regularExpressionLiteral = 7, + whiteSpace = 8, + text = 9, + punctuation = 10, + className = 11, + enumName = 12, + interfaceName = 13, + moduleName = 14, + typeParameterName = 15, + typeAliasName = 16, + parameterName = 17, + docCommentTagName = 18, + jsxOpenTagName = 19, + jsxCloseTagName = 20, + jsxSelfClosingTagName = 21, + jsxAttribute = 22, + jsxText = 23, + jsxAttributeStringLiteralValue = 24, + bigintLiteral = 25, + } + + export interface EncodedSemanticClassificationsResponse extends Proto.Response { + body?: { + endOfLineState: EndOfLineState; + spans: number[]; + }; + } + + export interface ExtendedTsServerRequests { + 'encodedSemanticClassifications-full': [ExperimentalProtocol.EncodedSemanticClassificationsRequestArgs, ExperimentalProtocol.EncodedSemanticClassificationsResponse]; + } +} diff --git a/extensions/typescript-language-features/src/features/task.ts b/extensions/typescript-language-features/src/features/task.ts index 48f9ca27d4a..b63ff25019f 100644 --- a/extensions/typescript-language-features/src/features/task.ts +++ b/extensions/typescript-language-features/src/features/task.ts @@ -72,32 +72,31 @@ export default class TscTaskProvider implements vscode.TaskProvider { return tasks; } - public async resolveTask(_task: vscode.Task): Promise { - const definition = _task.definition; - const badTsconfig = /\\tsconfig.*\.json/; - if (badTsconfig.exec(definition.tsconfig) !== null) { + public async resolveTask(task: vscode.Task): Promise { + const definition = task.definition; + if (/\\tsconfig.*\.json/.test(definition.tsconfig)) { // Warn that the task has the wrong slash type vscode.window.showWarningMessage(localize('badTsConfig', "TypeScript Task in tasks.json contains \"\\\\\". TypeScript tasks tsconfig must use \"/\"")); return undefined; } - const typescriptTask = (_task.definition).tsconfig; - if (typescriptTask) { - if (_task.scope === undefined || _task.scope === vscode.TaskScope.Global || _task.scope === vscode.TaskScope.Workspace) { - // scope is required to be a WorkspaceFolder for resolveTask - return undefined; - } - const kind: TypeScriptTaskDefinition = (_task.definition); - const tsconfigUri: vscode.Uri = _task.scope.uri.with({ path: _task.scope.uri.path + '/' + kind.tsconfig }); - const tsconfig: TSConfig = { - uri: tsconfigUri, - fsPath: tsconfigUri.fsPath, - posixPath: tsconfigUri.path, - workspaceFolder: _task.scope - }; - return this.getTasksForProjectAndDefinition(tsconfig, kind); + const tsconfigPath = definition.tsconfig; + if (!tsconfigPath) { + return undefined; } - return undefined; + + if (task.scope === undefined || task.scope === vscode.TaskScope.Global || task.scope === vscode.TaskScope.Workspace) { + // scope is required to be a WorkspaceFolder for resolveTask + return undefined; + } + const tsconfigUri = task.scope.uri.with({ path: task.scope.uri.path + '/' + tsconfigPath }); + const tsconfig: TSConfig = { + uri: tsconfigUri, + fsPath: tsconfigUri.fsPath, + posixPath: tsconfigUri.path, + workspaceFolder: task.scope + }; + return this.getTasksForProjectAndDefinition(tsconfig, definition); } private async getAllTsConfigs(token: vscode.CancellationToken): Promise { diff --git a/extensions/typescript-language-features/src/languageProvider.ts b/extensions/typescript-language-features/src/languageProvider.ts index a73cd46409d..644eed40441 100644 --- a/extensions/typescript-language-features/src/languageProvider.ts +++ b/extensions/typescript-language-features/src/languageProvider.ts @@ -78,6 +78,7 @@ export default class LanguageProvider extends Disposable { import('./features/signatureHelp').then(provider => this._register(provider.register(selector, this.client))), import('./features/tagClosing').then(provider => this._register(provider.register(selector, this.description.id, this.client))), import('./features/typeDefinitions').then(provider => this._register(provider.register(selector, this.client))), + import('./features/semanticTokens').then(provider => this._register(provider.register(selector, this.client))), import('./features/callHierarchy').then(provider => this._register(provider.register(selector, this.client))), ]); } diff --git a/extensions/typescript-language-features/src/tsServer/callbackMap.ts b/extensions/typescript-language-features/src/tsServer/callbackMap.ts index 7f96de57159..a5ac85388bb 100644 --- a/extensions/typescript-language-features/src/tsServer/callbackMap.ts +++ b/extensions/typescript-language-features/src/tsServer/callbackMap.ts @@ -9,7 +9,7 @@ import { ServerResponse } from '../typescriptService'; export interface CallbackItem { readonly onSuccess: (value: R) => void; readonly onError: (err: Error) => void; - readonly startTime: number; + readonly queuingStartTime: number; readonly isAsync: boolean; } @@ -48,4 +48,4 @@ export class CallbackMap { this._asyncCallbacks.delete(seq); } } -} \ No newline at end of file +} diff --git a/extensions/typescript-language-features/src/tsServer/server.ts b/extensions/typescript-language-features/src/tsServer/server.ts index d23b4b13f83..b538083b7f7 100644 --- a/extensions/typescript-language-features/src/tsServer/server.ts +++ b/extensions/typescript-language-features/src/tsServer/server.ts @@ -140,10 +140,10 @@ export class ProcessBasedTsServer extends Disposable implements ITypeScriptServe const event = message as Proto.Event; if (event.event === 'requestCompleted') { const seq = (event as Proto.RequestCompletedEvent).body.request_seq; - const p = this._callbacks.fetch(seq); - if (p) { - this._tracer.traceRequestCompleted(this._serverId, 'requestCompleted', seq, p.startTime); - p.onSuccess(undefined); + const callback = this._callbacks.fetch(seq); + if (callback) { + this._tracer.traceRequestCompleted(this._serverId, 'requestCompleted', seq, callback); + callback.onSuccess(undefined); } } else { this._tracer.traceEvent(this._serverId, event); @@ -186,7 +186,7 @@ export class ProcessBasedTsServer extends Disposable implements ITypeScriptServe return; } - this._tracer.traceResponse(this._serverId, response, callback.startTime); + this._tracer.traceResponse(this._serverId, response, callback); if (response.success) { callback.onSuccess(response); } else if (response.message === 'No content available.') { @@ -210,7 +210,7 @@ export class ProcessBasedTsServer extends Disposable implements ITypeScriptServe let result: Promise> | undefined; if (executeInfo.expectsResult) { result = new Promise>((resolve, reject) => { - this._callbacks.add(request.seq, { onSuccess: resolve, onError: reject, startTime: Date.now(), isAsync: executeInfo.isAsync }, executeInfo.isAsync); + this._callbacks.add(request.seq, { onSuccess: resolve, onError: reject, queuingStartTime: Date.now(), isAsync: executeInfo.isAsync }, executeInfo.isAsync); if (executeInfo.token) { executeInfo.token.onCancellationRequested(() => { diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index bb041b7676e..7046b67f4fc 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -52,6 +52,7 @@ namespace ServerState { export class Running { readonly type = Type.Running; + constructor( public readonly server: ITypeScriptServer, @@ -68,6 +69,14 @@ namespace ServerState { ) { } public readonly toCancelOnResourceChange = new Set(); + + updateTsserverVersion(tsserverVersion: string) { + this.tsserverVersion = tsserverVersion; + } + + updateLangaugeServiceEnabled(enabled: boolean) { + this.langaugeServiceEnabled = enabled; + } } export class Errored { @@ -173,7 +182,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType return this.serverState.tsserverVersion; } } - return this.apiVersion.version; + return this.apiVersion.fullVersionString; })); this.typescriptServerSpawner = new TypeScriptServerSpawner(this.versionProvider, this.logDirectoryProvider, this.pluginPathsProvider, this.logger, this.telemetryReporter, this.tracer); @@ -705,7 +714,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType return this.bufferSyncSupport.interuptGetErr(f); } - private fatalError(command: string, error: Error): void { + private fatalError(command: string, error: unknown): void { + if (!(error instanceof TypeScriptServerError)) { + console.log('fdasfasdf'); + } /* __GDPR__ "fatalError" : { "${include}": [ @@ -759,10 +771,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType { const body = (event as Proto.ProjectLanguageServiceStateEvent).body!; if (this.serverState.type === ServerState.Type.Running) { - this.serverState = { - ...this.serverState, - langaugeServiceEnabled: body.languageServiceEnabled, - }; + this.serverState.updateLangaugeServiceEnabled(body.languageServiceEnabled); } this._onProjectLanguageServiceStateChanged.fire(body); break; @@ -831,10 +840,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType } if (telemetryData.telemetryEventName === 'projectInfo') { if (this.serverState.type === ServerState.Type.Running) { - this.serverState = { - ...this.serverState, - tsserverVersion: properties['version'] - }; + this.serverState.updateTsserverVersion(properties['version']); } } diff --git a/extensions/typescript-language-features/src/utils/api.ts b/extensions/typescript-language-features/src/utils/api.ts index 0fa41cb01a0..fd2625b950e 100644 --- a/extensions/typescript-language-features/src/utils/api.ts +++ b/extensions/typescript-language-features/src/utils/api.ts @@ -10,7 +10,7 @@ const localize = nls.loadMessageBundle(); export default class API { private static fromSimpleString(value: string): API { - return new API(value, value); + return new API(value, value, value); } public static readonly defaultVersion = API.fromSimpleString('1.0.0'); @@ -36,7 +36,7 @@ export default class API { public static fromVersionString(versionString: string): API { let version = semver.valid(versionString); if (!version) { - return new API(localize('invalidVersion', 'invalid version'), '1.0.0'); + return new API(localize('invalidVersion', 'invalid version'), '1.0.0', '1.0.0'); } // Cut off any prerelease tag since we sometimes consume those on purpose. @@ -44,12 +44,24 @@ export default class API { if (index >= 0) { version = version.substr(0, index); } - return new API(versionString, version); + return new API(versionString, version, versionString); } private constructor( + /** + * Human readable string for the current version. Displayed in the UI + */ public readonly displayName: string, - public readonly version: string + + /** + * Semver version, e.g. '3.9.0' + */ + public readonly version: string, + + /** + * Full version string including pre-release tags, e.g. '3.9.0-beta' + */ + public readonly fullVersionString: string, ) { } public gte(other: API): boolean { diff --git a/extensions/typescript-language-features/src/utils/telemetry.ts b/extensions/typescript-language-features/src/utils/telemetry.ts index 296277ba028..13527cae125 100644 --- a/extensions/typescript-language-features/src/utils/telemetry.ts +++ b/extensions/typescript-language-features/src/utils/telemetry.ts @@ -30,22 +30,20 @@ export class VSCodeTelemetryReporter implements TelemetryReporter { private readonly clientVersionDelegate: () => string ) { } - public logTelemetry(eventName: string, properties?: { [prop: string]: string }) { + public logTelemetry(eventName: string, properties: { [prop: string]: string } = {}) { const reporter = this.reporter; - if (reporter) { - if (!properties) { - properties = {}; - } - - /* __GDPR__FRAGMENT__ - "TypeScriptCommonProperties" : { - "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - properties['version'] = this.clientVersionDelegate(); - - reporter.sendTelemetryEvent(eventName, properties); + if (!reporter) { + return; } + + /* __GDPR__FRAGMENT__ + "TypeScriptCommonProperties" : { + "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ + properties['version'] = this.clientVersionDelegate(); + + reporter.sendTelemetryEvent(eventName, properties); } public dispose() { diff --git a/extensions/typescript-language-features/src/utils/tracer.ts b/extensions/typescript-language-features/src/utils/tracer.ts index f7ca0d674e3..b8e5b189a8b 100644 --- a/extensions/typescript-language-features/src/utils/tracer.ts +++ b/extensions/typescript-language-features/src/utils/tracer.ts @@ -29,6 +29,10 @@ namespace Trace { } } +interface RequestExecutionMetadata { + readonly queuingStartTime: number +} + export default class Tracer { private trace?: Trace; @@ -61,7 +65,7 @@ export default class Tracer { this.logTrace(serverId, `Sending request: ${request.command} (${request.seq}). Response expected: ${responseExpected ? 'yes' : 'no'}. Current queue length: ${queueLength}`, data); } - public traceResponse(serverId: string, response: Proto.Response, startTime: number): void { + public traceResponse(serverId: string, response: Proto.Response, meta: RequestExecutionMetadata): void { if (this.trace === Trace.Off) { return; } @@ -69,14 +73,14 @@ export default class Tracer { if (this.trace === Trace.Verbose && response.body) { data = `Result: ${JSON.stringify(response.body, null, 4)}`; } - this.logTrace(serverId, `Response received: ${response.command} (${response.request_seq}). Request took ${Date.now() - startTime} ms. Success: ${response.success} ${!response.success ? '. Message: ' + response.message : ''}`, data); + this.logTrace(serverId, `Response received: ${response.command} (${response.request_seq}). Request took ${Date.now() - meta.queuingStartTime} ms. Success: ${response.success} ${!response.success ? '. Message: ' + response.message : ''}`, data); } - public traceRequestCompleted(serverId: string, command: string, request_seq: number, startTime: number): any { + public traceRequestCompleted(serverId: string, command: string, request_seq: number, meta: RequestExecutionMetadata): any { if (this.trace === Trace.Off) { return; } - this.logTrace(serverId, `Async response received: ${command} (${request_seq}). Request took ${Date.now() - startTime} ms.`); + this.logTrace(serverId, `Async response received: ${command} (${request_seq}). Request took ${Date.now() - meta.queuingStartTime} ms.`); } public traceEvent(serverId: string, event: Proto.Event): void { @@ -95,4 +99,4 @@ export default class Tracer { this.logger.logLevel('Trace', `<${serverId}> ${message}`, data); } } -} \ No newline at end of file +} diff --git a/extensions/typescript-language-features/src/utils/tsconfigProvider.ts b/extensions/typescript-language-features/src/utils/tsconfigProvider.ts index 04843d0058a..e77dfb306a9 100644 --- a/extensions/typescript-language-features/src/utils/tsconfigProvider.ts +++ b/extensions/typescript-language-features/src/utils/tsconfigProvider.ts @@ -18,7 +18,7 @@ export default class TsConfigProvider { return []; } const configs = new Map(); - for (const config of await vscode.workspace.findFiles('**/tsconfig*.json', '**/node_modules/**')) { + for (const config of await vscode.workspace.findFiles('**/tsconfig*.json', '**/{node_modules,.*}/**')) { const root = vscode.workspace.getWorkspaceFolder(config); if (root) { configs.set(config.fsPath, { diff --git a/extensions/typescript-language-features/yarn.lock b/extensions/typescript-language-features/yarn.lock index a45e26290c6..f3916e1231d 100644 --- a/extensions/typescript-language-features/yarn.lock +++ b/extensions/typescript-language-features/yarn.lock @@ -22,14 +22,14 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*": - version "12.0.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.2.tgz#3452a24edf9fea138b48fad4a0a028a683da1e40" - integrity sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA== + version "13.1.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.6.tgz#076028d0b0400be8105b89a0a55550c86684ffec" + integrity "sha1-B2Ao0LBAC+gQW4mgpVVQyGaE/+w= sha512-Jg1F+bmxcpENHP23sVKkNuU3uaxPnsBMW0cLjleiikFKomJQbsn0Cqk2yDvQArqzZN6ABfBkZ0To7pQ8sLdWDg==" "@types/node@^12.11.7": - version "12.11.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.7.tgz#57682a9771a3f7b09c2497f28129a0462966524a" - integrity sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA== + version "12.12.24" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.24.tgz#d4606afd8cf6c609036b854360367d1b2c78931f" + integrity "sha1-1GBq/Yz2xgkDa4VDYDZ9Gyx4kx8= sha512-1Ciqv9pqwVtW6FsIUKSZNB82E5Cu1I2bBTj1xuIHXLe/1zYLl3956Nbhg2MzSYHVfl9/rmanjbQIb7LibfCnug==" "@types/rimraf@2.0.2": version "2.0.2" @@ -44,51 +44,22 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== -ajv@^5.1.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= +agent-base@4, agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" + es6-promisify "^5.0.0" + +ajv@^6.5.5: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== + dependencies: + fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ansi-cyan@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-cyan/-/ansi-cyan-0.1.1.tgz#538ae528af8982f28ae30d86f2f17456d2609873" - integrity sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM= - 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-red@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-red/-/ansi-red-0.1.1.tgz#8c638f9d1080800a353c9c28c8a81ca4705d946c" - integrity sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw= - dependencies: - ansi-wrap "0.1.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -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= + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" applicationinsights@1.0.8: version "1.0.8" @@ -99,67 +70,12 @@ applicationinsights@1.0.8: diagnostic-channel-publishers "0.2.1" zone.js "0.7.6" -arr-diff@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-1.1.0.tgz#687c32758163588fef7de7b36fabe495eb1a399a" - integrity sha1-aHwydYFjWI/vfeezb6vklesaOZo= - dependencies: - arr-flatten "^1.0.1" - array-slice "^0.2.3" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-flatten@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-2.1.0.tgz#20f9eab5ec70f5c7d215b1077b1c39161d292c7d" - integrity sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0= - -array-differ@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" - integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1, array-uniq@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" - integrity sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y= + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" @@ -176,10 +92,10 @@ aws-sign2@~0.7.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= -aws4@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" - integrity sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w== +aws4@^1.8.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c" + integrity "sha1-JDkOatYThrCnRyZXVNKhchnehiw= sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==" balanced-match@^1.0.0: version "1.0.0" @@ -187,38 +103,12 @@ balanced-match@^1.0.0: integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" - integrity sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40= + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" -beeper@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" - integrity sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak= - -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= - dependencies: - inherits "~2.0.0" - -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - integrity sha1-T4owBctKfjiJ90kDD9JbluAdLjE= - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - integrity sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw== - dependencies: - hoek "4.x.x" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -227,129 +117,43 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= - -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= +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== buffer-from@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" - integrity sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA== + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - 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" - -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-stats@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" - integrity sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE= - -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@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" - integrity sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8= - -clone@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -clone@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" - integrity sha1-0hfR6WERjjrJpLi7oyhVU79kfNs= - -cloneable-readable@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.2.tgz#d591dee4a8f8bc15da43ce97dceeba13d43e2a65" - integrity sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg== - dependencies: - inherits "^2.0.1" - process-nextick-args "^2.0.0" - readable-stream "^2.3.5" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -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== - -combined-stream@1.0.6, combined-stream@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - integrity sha1-cj599ugBrFYTETp+RFqbactjKBg= +combined-stream@^1.0.6, combined-stream@~1.0.6: + 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.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== 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= -convert-source-map@^1.1.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" - integrity sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU= - -core-util-is@1.0.2, core-util-is@~1.0.0: +core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - integrity sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4= - dependencies: - boom "5.x.x" - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -357,11 +161,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -dateformat@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" - integrity sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI= - debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -369,12 +168,12 @@ debug@3.1.0: dependencies: ms "2.0.0" -deep-assign@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-1.0.0.tgz#b092743be8427dc621ea0067cdec7e70dd19f37b" - integrity sha1-sJJ0O+hCfcYh6gBnzex+cN0Z83s= +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: - is-obj "^1.0.0" + ms "^2.1.1" delayed-stream@~1.0.0: version "1.0.0" @@ -393,104 +192,40 @@ diagnostic-channel@0.2.0: dependencies: semver "^5.3.0" -diff@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" - integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== - -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" - integrity sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds= - dependencies: - readable-stream "~1.1.9" - -duplexer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= - -duplexify@^3.2.0: - version "3.5.4" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.4.tgz#4bb46c1796eabebeec4ca9a2e66b808cb7a3d8b4" - integrity sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" - integrity sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU= + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" + safer-buffer "^2.1.0" -end-of-stream@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== +es6-promise@^4.0.3: + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= dependencies: - once "^1.4.0" + es6-promise "^4.0.3" -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2: +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= -event-stream@^3.3.1, event-stream@^3.3.4, event-stream@~3.3.4: - version "3.3.4" - resolved "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - integrity sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE= - 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" - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -extend-shallow@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-1.1.4.tgz#19d6bf94dfc09d76ba711f39b872d21ff4dd9071" - integrity sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE= - dependencies: - kind-of "^1.1.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend@^3.0.0, extend@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" - integrity sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ= - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" +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== extsprintf@1.3.0: version "1.3.0" @@ -502,99 +237,35 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fancy-log@^1.1.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" - integrity sha1-9BEl49hPLn2JpD0G2VjI94vha+E= - dependencies: - ansi-gray "^0.1.1" - color-support "^1.1.3" - time-stamp "^1.0.0" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -fd-slicer@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65" - integrity sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU= - dependencies: - pend "~1.2.0" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fill-range@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" - integrity sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM= - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^1.1.3" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -first-chunk-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" - integrity sha1-Wb+1DNkF9g18OUzT2ayqtOatk04= - -for-in@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM= sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -form-data@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - integrity sha1-SXBJi+YEwgwAXU9cI67NIda0kJk= +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== dependencies: asynckit "^0.4.0" - combined-stream "1.0.6" + combined-stream "^1.0.6" mime-types "^2.1.12" -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" - integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= - 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= -fstream@^1.0.2: - version "1.0.11" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" - integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -602,44 +273,7 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-stream@^5.3.2: - version "5.3.5" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-5.3.5.tgz#a55665a9a8ccdc41915a87c701e32d4e016fad22" - integrity sha1-pVZlqajM3EGRWofHAeMtTgFvrSI= - dependencies: - extend "^3.0.0" - glob "^5.0.3" - glob-parent "^3.0.0" - micromatch "^2.3.7" - ordered-read-streams "^0.3.0" - through2 "^0.6.0" - to-absolute-glob "^0.1.1" - unique-stream "^2.0.2" - -glob@7.1.2, glob@^7.0.5, glob@^7.1.2: +glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== @@ -651,21 +285,10 @@ glob@7.1.2, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^5.0.3: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== +glob@^7.1.2, glob@^7.1.3: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -674,187 +297,41 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glogg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.1.tgz#dcf758e44789cc3f3d32c1f3562a3676e6a34810" - integrity sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw== - dependencies: - sparkles "^1.0.0" - -graceful-fs@^4.0.0, graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= - -growl@1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" - integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== - -gulp-chmod@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/gulp-chmod/-/gulp-chmod-2.0.0.tgz#00c390b928a0799b251accf631aa09e01cc6299c" - integrity sha1-AMOQuSigeZslGsz2MaoJ4BzGKZw= - dependencies: - deep-assign "^1.0.0" - stat-mode "^0.2.0" - through2 "^2.0.0" - -gulp-filter@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/gulp-filter/-/gulp-filter-5.1.0.tgz#a05e11affb07cf7dcf41a7de1cb7b63ac3783e73" - integrity sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM= - dependencies: - multimatch "^2.0.0" - plugin-error "^0.1.2" - streamfilter "^1.0.5" - -gulp-gunzip@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulp-gunzip/-/gulp-gunzip-1.0.0.tgz#15b741145e83a9c6f50886241b57cc5871f151a9" - integrity sha1-FbdBFF6Dqcb1CIYkG1fMWHHxUak= - dependencies: - through2 "~0.6.5" - vinyl "~0.4.6" - -gulp-remote-src-vscode@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/gulp-remote-src-vscode/-/gulp-remote-src-vscode-0.5.0.tgz#71785553bc491880088ad971f90910c4b2d80a99" - integrity sha512-/9vtSk9eI9DEWCqzGieglPqmx0WUQ9pwPHyHFpKmfxqdgqGJC2l0vFMdYs54hLdDsMDEZFLDL2J4ikjc4hQ5HQ== - dependencies: - event-stream "^3.3.4" - node.extend "^1.1.2" - request "^2.79.0" - through2 "^2.0.3" - vinyl "^2.0.1" - -gulp-sourcemaps@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz#b86ff349d801ceb56e1d9e7dc7bbcb4b7dee600c" - integrity sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw= - dependencies: - convert-source-map "^1.1.1" - graceful-fs "^4.1.2" - strip-bom "^2.0.0" - through2 "^2.0.0" - vinyl "^1.0.0" - -gulp-symdest@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/gulp-symdest/-/gulp-symdest-1.1.0.tgz#c165320732d192ce56fd94271ffa123234bf2ae0" - integrity sha1-wWUyBzLRks5W/ZQnH/oSMjS/KuA= - dependencies: - event-stream "^3.3.1" - mkdirp "^0.5.1" - queue "^3.1.0" - vinyl-fs "^2.4.3" - -gulp-untar@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/gulp-untar/-/gulp-untar-0.0.6.tgz#d6bdefde7e9a8e054c9f162385a0782c4be74000" - integrity sha1-1r3v3n6ajgVMnxYjhaB4LEvnQAA= - dependencies: - event-stream "~3.3.4" - gulp-util "~3.0.8" - streamifier "~0.1.1" - tar "^2.2.1" - through2 "~2.0.3" - -gulp-util@~3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" - integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08= - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^2.0.0" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" - -gulp-vinyl-zip@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.0.tgz#24e40685dc05b7149995245099e0590263be8dad" - integrity sha1-JOQGhdwFtxSZlSRQmeBZAmO+ja0= - dependencies: - event-stream "^3.3.1" - queue "^4.2.1" - through2 "^2.0.3" - vinyl "^2.0.2" - vinyl-fs "^2.0.0" - yauzl "^2.2.1" - yazl "^2.2.1" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= - dependencies: - glogg "^1.0.0" +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - integrity sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0= +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== dependencies: - ajv "^5.1.0" + ajv "^6.5.5" har-schema "^2.0.0" -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - integrity sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4= - dependencies: - sparkles "^1.0.0" - -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - integrity sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ== - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" +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= he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= -hoek@4.x.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" - integrity sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA== +http-proxy-agent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== + dependencies: + agent-base "4" + debug "3.1.0" http-signature@~1.2.0: version "1.2.0" @@ -865,6 +342,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +https-proxy-agent@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" + integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== + dependencies: + agent-base "^4.3.0" + debug "^3.1.0" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -873,128 +358,16 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-extglob@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-stream@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -is-valid-glob@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe" - integrity sha1-1LVcafUYhvm2XHDWwmItN+KfSP4= - -is@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/is/-/is-3.2.1.tgz#d0ac2ad55eb7b0bec926a5266f6c662aaa83dca5" - integrity sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU= - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - -isarray@1.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= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -1005,37 +378,25 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= -json-stable-stringify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= - dependencies: - jsonify "~0.0.0" - 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= jsonc-parser@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.1.1.tgz#83dc3d7a6e7186346b889b1280eefa04446c6d3e" - integrity sha512-VC0CjnWJylKB1iov4u76/W/5Ef0ydDkjtYWxoZ9t3HdWlSnZQwZL5MgFikaB/EtQ4RmMEw3tmQzuYnZA2/Ja1g== - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= + version "2.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.0.tgz#f206f87f9d49d644b7502052c04e82dd6392e9ef" + integrity sha512-4fLQxW1j/5fWj6p78vAlAafoCKtuBm6ghv+Ij5W2DrDx0qE+ZdEl2c6Ko1mgJNF5ftX1iEWQQ4Ap7+3GlhjkOA== jsprim@^1.2.2: version "1.4.1" @@ -1047,180 +408,19 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -kind-of@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-1.1.0.tgz#140a3d2d41a36d2efcfa9377b62c24f8495a5c44" - integrity sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ= +mime-db@1.43.0: + version "1.43.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" + integrity "sha1-ChLgUCZQ5HPXNVNQUOfI9OtPrlg= sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" -kind-of@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.26" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" + integrity "sha1-nJIfwJt+FJpl39wNpNIJlyALCgY= sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==" dependencies: - is-buffer "^1.1.5" + mime-db "1.43.0" -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= - dependencies: - readable-stream "^2.0.5" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - integrity sha1-jaDmqHbPNEwK2KVIghEd08XHyjY= - -lodash._basetostring@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" - integrity sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U= - -lodash._basevalues@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" - integrity sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc= - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - integrity sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw= - -lodash._reescape@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" - integrity sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo= - -lodash._reevaluate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" - integrity sha1-WLx0xAZklTrgsSTYBpltrKQx4u0= - -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= - -lodash._root@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" - integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= - -lodash.escape@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" - integrity sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg= - dependencies: - lodash._root "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - integrity sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo= - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - integrity sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U= - -lodash.isequal@^4.0.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - integrity sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo= - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - -lodash.template@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" - integrity sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8= - dependencies: - lodash._basecopy "^3.0.0" - lodash._basetostring "^3.0.0" - lodash._basevalues "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.keys "^3.0.0" - lodash.restparam "^3.0.0" - lodash.templatesettings "^3.0.0" - -lodash.templatesettings@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" - integrity sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU= - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= - -merge-stream@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" - integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= - dependencies: - readable-stream "^2.0.1" - -micromatch@^2.3.7: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -mime-db@~1.33.0: - version "1.33.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" - integrity sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ== - -mime-types@^2.1.12, mime-types@~2.1.17: - version "2.1.18" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" - integrity sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ== - dependencies: - mime-db "~1.33.0" - -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.4: +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== @@ -1232,319 +432,134 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" -mocha@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" - integrity sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA== +mocha@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== dependencies: - browser-stdout "1.3.0" - commander "2.11.0" + browser-stdout "1.3.1" + commander "2.15.1" debug "3.1.0" - diff "3.3.1" + diff "3.5.0" escape-string-regexp "1.0.5" glob "7.1.2" - growl "1.10.3" + growl "1.10.5" he "1.1.1" + minimatch "3.0.4" mkdirp "0.5.1" - supports-color "4.4.0" + supports-color "5.4.0" ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -multimatch@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" - integrity sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis= - dependencies: - array-differ "^1.0.0" - array-union "^1.0.1" - arrify "^1.0.0" - minimatch "^3.0.0" +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -multipipe@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" - integrity sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s= - dependencies: - duplexer2 "0.0.2" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -node.extend@^1.1.2: - version "1.1.6" - resolved "https://registry.yarnpkg.com/node.extend/-/node.extend-1.1.6.tgz#a7b882c82d6c93a4863a5504bd5de8ec86258b96" - integrity sha1-p7iCyC1sk6SGOlUEvV3o7IYli5Y= - dependencies: - is "^3.1.0" - -normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - integrity sha1-Rqarfwrq2N6unsBWV4C31O/rnUM= - -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - integrity sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I= - -object-assign@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -once@^1.3.0, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" -ordered-read-streams@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b" - integrity sha1-cTfmmzKYuzQiR6G77jiByA4v14s= - dependencies: - is-stream "^1.0.1" - readable-stream "^2.0.1" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - 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= -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - integrity sha1-/lo0sMvOErWqaitAPuLnO2AvFEU= - dependencies: - through "~2.3" - -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -plugin-error@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-0.1.2.tgz#3b9bb3335ccf00f425e07437e19276967da47ace" - integrity sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4= - 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" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - -process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== +psl@^1.1.24: + version "1.7.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.7.0.tgz#f1c4c47a8ef97167dea5d6bbf4816d736e884a3c" + integrity "sha1-8cTEeo75cWfepda79IFtc26ISjw= sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==" punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -qs@~6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" - integrity sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A== +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -querystringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.0.0.tgz#fa3ed6e68eb15159457c89b37bc6472833195755" - integrity sha512-eTPo5t/4bgaMNZxyjWx6N2a6AuE0mq51KWvpc7nU/MAqixcI6v6KrGUKES0HaomdnolQBBXU/++X6/QQ9KL4tw== +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -queue@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/queue/-/queue-3.1.0.tgz#6c49d01f009e2256788789f2bffac6b8b9990585" - integrity sha1-bEnQHwCeIlZ4h4nyv/rGuLmZBYU= - dependencies: - inherits "~2.0.0" +querystringify@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" + integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== -queue@^4.2.1: - version "4.4.2" - resolved "https://registry.yarnpkg.com/queue/-/queue-4.4.2.tgz#5a9733d9a8b8bd1b36e934bc9c55ab89b28e29c7" - integrity sha512-fSMRXbwhMwipcDZ08enW2vl+YDmAmhcNcr43sCJL8DIg+CFOsoRLG23ctxA+fwNk1w55SePSiS7oqQQSgQoVJQ== - dependencies: - inherits "~2.0.0" - -randomatic@^1.1.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" - integrity sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -"readable-stream@>=1.0.33-1 <1.1.0-0": - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - 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" - -readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - -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= - -repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - integrity sha1-7wiaF40Ug7quTZPrmLT55OEdmQo= - -repeat-string@^1.5.2: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -replace-ext@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" - integrity sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ= - -replace-ext@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" - integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= - -request@^2.79.0, request@^2.83.0: - version "2.85.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" - integrity sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg== +request@^2.88.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== dependencies: aws-sign2 "~0.7.0" - aws4 "^1.6.0" + aws4 "^1.8.0" caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" + combined-stream "~1.0.6" + extend "~3.0.2" forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" + form-data "~2.3.2" + har-validator "~5.1.0" http-signature "~1.2.0" is-typedarray "~1.0.0" isstream "~0.1.2" json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" + mime-types "~2.1.19" + oauth-sign "~0.9.0" performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" tunnel-agent "^0.6.0" - uuid "^3.1.0" + uuid "^3.3.2" requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= -rimraf@2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== - dependencies: - glob "^7.0.5" - rimraf@^2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, 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== +safe-buffer@^5.0.1, safe-buffer@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== semver@5.5.1: version "5.5.1" @@ -1552,21 +567,14 @@ semver@5.5.1: integrity sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw== semver@^5.3.0, semver@^5.4.1: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - integrity sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg== - dependencies: - hoek "4.x.x" + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== source-map-support@^0.5.0: - version "0.5.5" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.5.tgz#0d4af9e00493e855402e8ec36ebed2d266fceb90" - integrity sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA== + version "0.5.16" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" + integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -1576,168 +584,34 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -sparkles@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" - integrity sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM= - -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - integrity sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8= - dependencies: - through "2" - sshpk@^1.7.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" - integrity sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s= + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - optionalDependencies: bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" ecc-jsbn "~0.1.1" + getpass "^0.1.1" jsbn "~0.1.0" + safer-buffer "^2.0.2" tweetnacl "~0.14.0" -stat-mode@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/stat-mode/-/stat-mode-0.2.2.tgz#e6c80b623123d7d80cf132ce538f346289072502" - integrity sha1-5sgLYjEj19gM8TLOU480YokHJQI= - -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" - integrity sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ= +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== dependencies: - duplexer "~0.1.1" + has-flag "^3.0.0" -stream-shift@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" - integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= - -streamfilter@^1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/streamfilter/-/streamfilter-1.0.7.tgz#ae3e64522aa5a35c061fd17f67620c7653c643c9" - integrity sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ== - dependencies: - readable-stream "^2.0.2" - -streamifier@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/streamifier/-/streamifier-0.1.1.tgz#97e98d8fa4d105d62a2691d1dc07e820db8dfc4f" - integrity sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8= - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -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" - -stringstream@~0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" - integrity sha1-TkhM1N5aC7vuGORjB3EKioFiGHg= - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-bom-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" - integrity sha1-5xRDmFd9Uaa+0PoZlPoF9D/ZiO4= - dependencies: - first-chunk-stream "^1.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" - -supports-color@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" - integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== - dependencies: - has-flag "^2.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -tar@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= - dependencies: - block-stream "*" - fstream "^1.0.2" - inherits "2" - -through2-filter@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" - integrity sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw= - dependencies: - through2 "~2.0.0" - xtend "~4.0.0" - -through2@^0.6.0, through2@~0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" - integrity sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg= - dependencies: - readable-stream ">=1.0.33-1 <1.1.0-0" - xtend ">=4.0.0 <4.1.0-0" - -through2@^2.0.0, through2@^2.0.3, through2@~2.0.0, through2@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" - integrity sha1-AARWmzfHx0ujnEPzzteNGtlBQL4= - dependencies: - readable-stream "^2.1.5" - xtend "~4.0.1" - -through@2, through@~2.3, through@~2.3.1: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -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= - -to-absolute-glob@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f" - integrity sha1-HN+kcqnvUMI57maZm2YsoOs5k38= - dependencies: - extend-shallow "^2.0.1" - -tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - integrity sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA== +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== dependencies: + psl "^1.1.24" punycode "^1.4.1" tunnel-agent@^0.6.0: @@ -1752,36 +626,30 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= -unique-stream@^2.0.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369" - integrity sha1-WqADz76Uxf+GbE59ZouxxNuts2k= - dependencies: - json-stable-stringify "^1.0.0" - through2-filter "^2.0.0" +typescript-vscode-sh-plugin@^0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/typescript-vscode-sh-plugin/-/typescript-vscode-sh-plugin-0.6.4.tgz#6f6200b6e62761264973e10c34797394c8a212bf" + integrity sha512-fEND29A6Ri/LGf/y1ooFtnwQJG/IQSrcMRdSG1hXWF+Ggg5KjeVj7cPijlX+gA7Z8VsOI4DNhW9RZtHI7cS7Qg== -url-parse@^1.1.9: - version "1.4.0" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.0.tgz#6bfdaad60098c7fe06f623e42b22de62de0d3d75" - integrity sha512-ERuGxDiQ6Xw/agN4tuoCRbmwRuZP0cJ1lJxJubXr5Q/5cDa78+Dc4wfvtxzhzhkm5VvmW6Mf8EVj9SPGN4l8Lg== +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: - querystringify "^2.0.0" + punycode "^2.1.0" + +url-parse@^1.4.4: + version "1.4.7" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" + integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== + dependencies: + querystringify "^2.1.1" requires-port "^1.0.0" -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@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" - integrity sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA== - -vali-date@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" - integrity sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY= +uuid@^3.3.2: + version "3.3.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" + integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== verror@1.10.0: version "1.10.0" @@ -1792,75 +660,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vinyl-fs@^2.0.0, vinyl-fs@^2.4.3: - version "2.4.4" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-2.4.4.tgz#be6ff3270cb55dfd7d3063640de81f25d7532239" - integrity sha1-vm/zJwy1Xf19MGNkDegfJddTIjk= - dependencies: - duplexify "^3.2.0" - glob-stream "^5.3.2" - graceful-fs "^4.0.0" - gulp-sourcemaps "1.6.0" - is-valid-glob "^0.3.0" - lazystream "^1.0.0" - lodash.isequal "^4.0.0" - merge-stream "^1.0.0" - mkdirp "^0.5.0" - object-assign "^4.0.0" - readable-stream "^2.0.4" - strip-bom "^2.0.0" - strip-bom-stream "^1.0.0" - through2 "^2.0.0" - through2-filter "^2.0.0" - vali-date "^1.0.0" - vinyl "^1.0.0" - -vinyl-source-stream@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vinyl-source-stream/-/vinyl-source-stream-1.1.2.tgz#62b53a135610a896e98ca96bee3a87f008a8e780" - integrity sha1-YrU6E1YQqJbpjKlr7jqH8Aio54A= - dependencies: - through2 "^2.0.3" - vinyl "^0.4.3" - -vinyl@^0.4.3, vinyl@~0.4.6: - version "0.4.6" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.4.6.tgz#2f356c87a550a255461f36bbeb2a5ba8bf784847" - integrity sha1-LzVsh6VQolVGHza76ypbqL94SEc= - dependencies: - clone "^0.2.0" - clone-stats "^0.0.1" - -vinyl@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" - integrity sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4= - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - -vinyl@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" - integrity sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ= - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - -vinyl@^2.0.1, vinyl@^2.0.2: - version "2.1.0" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.1.0.tgz#021f9c2cf951d6b939943c89eb5ee5add4fd924c" - integrity sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw= - 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-extension-telemetry@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.1.tgz#91387e06b33400c57abd48979b0e790415ae110b" @@ -1869,55 +668,36 @@ vscode-extension-telemetry@0.1.1: applicationinsights "1.0.8" vscode-nls@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002" - integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw== + version "4.1.1" + resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c" + integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A== -vscode@^1.1.10: - version "1.1.17" - resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.17.tgz#cc2a61731e925301f03f003c009cbf454022cd83" - integrity sha512-yNMyrgEua2qyW7+trNNYhA6PeldRrBcwtLtlazkdtzcmkHMKECM/08bPF8HF2ZFuwHgD+8FQsdqd/DvJYQYjJg== +vscode-test@^0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/vscode-test/-/vscode-test-0.4.3.tgz#461ebf25fc4bc93d77d982aed556658a2e2b90b8" + integrity sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w== + dependencies: + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + +vscode@^1.1.36: + version "1.1.36" + resolved "https://registry.yarnpkg.com/vscode/-/vscode-1.1.36.tgz#5e1a0d1bf4977d0c7bc5159a9a13d5b104d4b1b6" + integrity sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ== dependencies: glob "^7.1.2" - gulp-chmod "^2.0.0" - gulp-filter "^5.0.1" - gulp-gunzip "1.0.0" - gulp-remote-src-vscode "^0.5.0" - gulp-symdest "^1.1.0" - gulp-untar "^0.0.6" - gulp-vinyl-zip "^2.1.0" - mocha "^4.0.1" - request "^2.83.0" + mocha "^5.2.0" + request "^2.88.0" semver "^5.4.1" source-map-support "^0.5.0" - url-parse "^1.1.9" - vinyl-source-stream "^1.1.0" + url-parse "^1.4.4" + vscode-test "^0.4.1" wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -"xtend@>=4.0.0 <4.1.0-0", xtend@~4.0.0, xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= - -yauzl@^2.2.1: - version "2.9.1" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.9.1.tgz#a81981ea70a57946133883f029c5821a89359a7f" - integrity sha1-qBmB6nCleUYTOIPwKcWCGok1mn8= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.0.1" - -yazl@^2.2.1: - 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" - zone.js@0.7.6: version "0.7.6" resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009" diff --git a/extensions/vscode-account/.vscodeignore b/extensions/vscode-account/.vscodeignore new file mode 100644 index 00000000000..ed3f9d37c1f --- /dev/null +++ b/extensions/vscode-account/.vscodeignore @@ -0,0 +1,10 @@ +.vscode/** +.vscode-test/** +out/test/** +src/** +.gitignore +vsc-extension-quickstart.md +**/tsconfig.json +**/tslint.json +**/*.map +**/*.ts \ No newline at end of file diff --git a/extensions/vscode-account/extension.webpack.config.js b/extensions/vscode-account/extension.webpack.config.js new file mode 100644 index 00000000000..a513ac5c3b5 --- /dev/null +++ b/extensions/vscode-account/extension.webpack.config.js @@ -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. + *--------------------------------------------------------------------------------------------*/ + +//@ts-check + +'use strict'; + +const withDefaults = require('../shared.webpack.config'); + +module.exports = withDefaults({ + context: __dirname, + entry: { + extension: './src/extension.ts', + }, + externals: { + 'keytar': 'commonjs keytar' + } +}); diff --git a/src/vs/platform/auth/common/auth.css b/extensions/vscode-account/media/auth.css similarity index 100% rename from src/vs/platform/auth/common/auth.css rename to extensions/vscode-account/media/auth.css diff --git a/src/vs/platform/auth/common/auth.html b/extensions/vscode-account/media/auth.html similarity index 99% rename from src/vs/platform/auth/common/auth.html rename to extensions/vscode-account/media/auth.html index 8fe3e50e7b7..0fcba4e3c62 100644 --- a/src/vs/platform/auth/common/auth.html +++ b/extensions/vscode-account/media/auth.html @@ -1,6 +1,7 @@ + @@ -8,6 +9,7 @@ + Visual Studio Code @@ -32,4 +34,5 @@ } + diff --git a/extensions/vscode-account/package.json b/extensions/vscode-account/package.json new file mode 100644 index 00000000000..35649821a85 --- /dev/null +++ b/extensions/vscode-account/package.json @@ -0,0 +1,30 @@ +{ + "name": "vscode-account", + "publisher": "vscode", + "displayName": "Account", + "description": "", + "version": "0.0.1", + "engines": { + "vscode": "^1.42.0" + }, + "categories": [ + "Other" + ], + "enableProposedApi": true, + "activationEvents": [ + "*" + ], + "main": "./out/extension.js", + "scripts": { + "vscode:prepublish": "npm run compile", + "compile": "tsc -p ./", + "watch": "tsc -watch -p ./" + }, + "devDependencies": { + "typescript": "^3.7.4", + "tslint": "^5.12.1", + "@types/node": "^10.12.21", + "@types/keytar": "^4.0.1", + "@types/vscode": "^1.41.0" + } +} diff --git a/extensions/vscode-account/src/AADHelper.ts b/extensions/vscode-account/src/AADHelper.ts new file mode 100644 index 00000000000..a6668d54db3 --- /dev/null +++ b/extensions/vscode-account/src/AADHelper.ts @@ -0,0 +1,498 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as crypto from 'crypto'; +import * as https from 'https'; +import * as querystring from 'querystring'; +import * as vscode from 'vscode'; +import { createServer, startServer } from './authServer'; +import { keychain } from './keychain'; +import Logger from './logger'; +import { toBase64UrlEncoding } from './utils'; + +const redirectUrl = 'https://vscode-redirect.azurewebsites.net/'; +const loginEndpointUrl = 'https://login.microsoftonline.com/'; +const clientId = 'aebc6443-996d-45c2-90f0-388ff96faa56'; +const tenant = 'organizations'; + +interface IToken { + expiresIn: string; // How long access token is valid, in seconds + accessToken: string; + refreshToken: string; + + displayName: string; + scope: string; + sessionId: string; // The account id + the scope +} + +interface ITokenClaims { + tid: string; + email?: string; + unique_name?: string; + oid?: string; + altsecid?: string; + scp: string; +} + +interface IStoredSession { + id: string; + refreshToken: string; + scope: string; // Scopes are alphabetized and joined with a space +} + +function parseQuery(uri: vscode.Uri) { + return uri.query.split('&').reduce((prev: any, current) => { + const queryString = current.split('='); + prev[queryString[0]] = queryString[1]; + return prev; + }, {}); +} + +export const onDidChangeSessions = new vscode.EventEmitter(); + +class UriEventHandler extends vscode.EventEmitter implements vscode.UriHandler { + public handleUri(uri: vscode.Uri) { + this.fire(uri); + } +} + +export class AzureActiveDirectoryService { + private _tokens: IToken[] = []; + private _refreshTimeouts: Map = new Map(); + private _uriHandler: UriEventHandler; + + constructor() { + this._uriHandler = new UriEventHandler(); + vscode.window.registerUriHandler(this._uriHandler); + } + + public async initialize(): Promise { + const storedData = await keychain.getToken(); + if (storedData) { + try { + const sessions = this.parseStoredData(storedData); + + // TODO remove, temporary fix to delete duplicated refresh tokens from https://github.com/microsoft/vscode/issues/89334 + const seen: { [key: string]: boolean; } = Object.create(null); + const dedupedSessions = sessions.filter(session => { + if (seen[session.id]) { + return false; + } + + seen[session.id] = true; + + return true; + }); + + const refreshes = dedupedSessions.map(async session => { + try { + await this.refreshToken(session.refreshToken, session.scope); + } catch (e) { + await this.logout(session.id); + } + }); + + await Promise.all(refreshes); + } catch (e) { + await this.clearSessions(); + } + } + + this.pollForChange(); + } + + private parseStoredData(data: string): IStoredSession[] { + return JSON.parse(data); + } + + private async storeTokenData(): Promise { + const serializedData: IStoredSession[] = this._tokens.map(token => { + return { + id: token.sessionId, + refreshToken: token.refreshToken, + scope: token.scope + }; + }); + + await keychain.setToken(JSON.stringify(serializedData)); + } + + private pollForChange() { + setTimeout(async () => { + let didChange = false; + const storedData = await keychain.getToken(); + if (storedData) { + try { + const sessions = this.parseStoredData(storedData); + let promises = sessions.map(async session => { + const matchesExisting = this._tokens.some(token => token.scope === session.scope && token.sessionId === session.id); + if (!matchesExisting) { + try { + await this.refreshToken(session.refreshToken, session.scope); + didChange = true; + } catch (e) { + await this.logout(session.id); + } + } + }); + + promises = promises.concat(this._tokens.map(async token => { + const matchesExisting = sessions.some(session => token.scope === session.scope && token.sessionId === session.id); + if (!matchesExisting) { + await this.logout(token.sessionId); + didChange = true; + } + })); + + await Promise.all(promises); + } catch (e) { + Logger.error(e.message); + // if data is improperly formatted, remove all of it and send change event + this.clearSessions(); + didChange = true; + } + } else { + if (this._tokens.length) { + // Log out all + await this.clearSessions(); + didChange = true; + } + } + + if (didChange) { + onDidChangeSessions.fire(); + } + + this.pollForChange(); + }, 1000 * 30); + } + + private convertToSession(token: IToken): vscode.Session { + return { + id: token.sessionId, + accessToken: token.accessToken, + displayName: token.displayName, + scopes: token.scope.split(' ') + }; + } + + private getTokenClaims(accessToken: string): ITokenClaims { + try { + return JSON.parse(Buffer.from(accessToken.split('.')[1], 'base64').toString()); + } catch (e) { + Logger.error(e.message); + throw new Error('Unable to read token claims'); + } + } + + get sessions(): vscode.Session[] { + return this._tokens.map(token => this.convertToSession(token)); + } + + public async login(scope: string): Promise { + Logger.info('Logging in...'); + + if (vscode.env.uiKind === vscode.UIKind.Web) { + await this.loginWithoutLocalServer(scope); + return; + } + + const nonce = crypto.randomBytes(16).toString('base64'); + const { server, redirectPromise, codePromise } = createServer(nonce); + + let token: IToken | undefined; + try { + const port = await startServer(server); + vscode.env.openExternal(vscode.Uri.parse(`http://localhost:${port}/signin?nonce=${encodeURIComponent(nonce)}`)); + + const redirectReq = await redirectPromise; + if ('err' in redirectReq) { + const { err, res } = redirectReq; + res.writeHead(302, { Location: `/?error=${encodeURIComponent(err && err.message || 'Unknown error')}` }); + res.end(); + throw err; + } + + const host = redirectReq.req.headers.host || ''; + const updatedPortStr = (/^[^:]+:(\d+)$/.exec(Array.isArray(host) ? host[0] : host) || [])[1]; + const updatedPort = updatedPortStr ? parseInt(updatedPortStr, 10) : port; + + const state = `${updatedPort},${encodeURIComponent(nonce)}`; + + const codeVerifier = toBase64UrlEncoding(crypto.randomBytes(32).toString('base64')); + const codeChallenge = toBase64UrlEncoding(crypto.createHash('sha256').update(codeVerifier).digest('base64')); + const loginUrl = `${loginEndpointUrl}${tenant}/oauth2/v2.0/authorize?response_type=code&response_mode=query&client_id=${encodeURIComponent(clientId)}&redirect_uri=${encodeURIComponent(redirectUrl)}&state=${state}&scope=${encodeURIComponent(scope)}&prompt=select_account&code_challenge_method=S256&code_challenge=${codeChallenge}`; + + await redirectReq.res.writeHead(302, { Location: loginUrl }); + redirectReq.res.end(); + + const codeRes = await codePromise; + const res = codeRes.res; + + try { + if ('err' in codeRes) { + throw codeRes.err; + } + token = await this.exchangeCodeForToken(codeRes.code, codeVerifier, scope); + this.setToken(token, scope); + Logger.info('Login successful'); + res.writeHead(302, { Location: '/' }); + res.end(); + } catch (err) { + Logger.error(err.message); + res.writeHead(302, { Location: `/?error=${encodeURIComponent(err && err.message || 'Unknown error')}` }); + res.end(); + } + } catch (e) { + Logger.error(e.message); + + // If the error was about starting the server, try directly hitting the login endpoint instead + if (e.message === 'Error listening to server' || e.message === 'Closed' || e.message === 'Timeout waiting for port') { + await this.loginWithoutLocalServer(scope); + } + } finally { + setTimeout(() => { + server.close(); + }, 5000); + } + } + + private getCallbackEnvironment(callbackUri: vscode.Uri): string { + switch (callbackUri.authority) { + case 'online.visualstudio.com': + return 'vso'; + case 'online-ppe.core.vsengsaas.visualstudio.com': + return 'vsoppe'; + case 'online.dev.core.vsengsaas.visualstudio.com': + return 'vsodev'; + default: + return vscode.env.uriScheme; + } + } + + private async loginWithoutLocalServer(scope: string): Promise { + const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.vscode-account`)); + const nonce = crypto.randomBytes(16).toString('base64'); + const port = (callbackUri.authority.match(/:([0-9]*)$/) || [])[1] || (callbackUri.scheme === 'https' ? 443 : 80); + const callbackEnvironment = this.getCallbackEnvironment(callbackUri); + const state = `${callbackEnvironment},${port},${encodeURIComponent(nonce)},${encodeURIComponent(callbackUri.query)}`; + const signInUrl = `${loginEndpointUrl}${tenant}/oauth2/v2.0/authorize`; + let uri = vscode.Uri.parse(signInUrl); + const codeVerifier = toBase64UrlEncoding(crypto.randomBytes(32).toString('base64')); + const codeChallenge = toBase64UrlEncoding(crypto.createHash('sha256').update(codeVerifier).digest('base64')); + uri = uri.with({ + query: `response_type=code&client_id=${encodeURIComponent(clientId)}&response_mode=query&redirect_uri=${redirectUrl}&state=${state}&scope=${scope}&prompt=select_account&code_challenge_method=S256&code_challenge=${codeChallenge}` + }); + vscode.env.openExternal(uri); + + const timeoutPromise = new Promise((resolve: (value: IToken) => void, reject) => { + const wait = setTimeout(() => { + clearTimeout(wait); + reject('Login timed out.'); + }, 1000 * 60 * 5); + }); + + return Promise.race([this.handleCodeResponse(state, codeVerifier, scope), timeoutPromise]); + } + + private async handleCodeResponse(state: string, codeVerifier: string, scope: string) { + let uriEventListener: vscode.Disposable; + return new Promise((resolve: (value: IToken) => void, reject) => { + uriEventListener = this._uriHandler.event(async (uri: vscode.Uri) => { + try { + const query = parseQuery(uri); + const code = query.code; + + if (query.state !== state) { + throw new Error('State does not match.'); + } + + const token = await this.exchangeCodeForToken(code, codeVerifier, scope); + this.setToken(token, scope); + + resolve(token); + } catch (err) { + reject(err); + } + }); + }).then(result => { + uriEventListener.dispose(); + return result; + }).catch(err => { + uriEventListener.dispose(); + throw err; + }); + } + + private async setToken(token: IToken, scope: string): Promise { + const existingTokenIndex = this._tokens.findIndex(t => t.sessionId === token.sessionId); + if (existingTokenIndex > -1) { + this._tokens.splice(existingTokenIndex, 1, token); + } else { + this._tokens.push(token); + } + + const existingTimeout = this._refreshTimeouts.get(token.sessionId); + if (existingTimeout) { + clearTimeout(existingTimeout); + } + + this._refreshTimeouts.set(token.sessionId, setTimeout(async () => { + try { + await this.refreshToken(token.refreshToken, scope); + } catch (e) { + await this.logout(token.sessionId); + } finally { + onDidChangeSessions.fire(); + } + }, 1000 * (parseInt(token.expiresIn) - 10))); + + this.storeTokenData(); + } + + private getTokenFromResponse(buffer: Buffer[], scope: string): IToken { + const json = JSON.parse(Buffer.concat(buffer).toString()); + const claims = this.getTokenClaims(json.access_token); + return { + expiresIn: json.expires_in, + accessToken: json.access_token, + refreshToken: json.refresh_token, + scope, + sessionId: claims.tid + (claims.oid || claims.altsecid) + scope, + displayName: claims.email || claims.unique_name || 'user@example.com' + }; + } + + private async exchangeCodeForToken(code: string, codeVerifier: string, scope: string): Promise { + return new Promise((resolve: (value: IToken) => void, reject) => { + Logger.info('Exchanging login code for token'); + try { + const postData = querystring.stringify({ + grant_type: 'authorization_code', + code: code, + client_id: clientId, + scope: scope, + code_verifier: codeVerifier, + redirect_uri: redirectUrl + }); + + const tokenUrl = vscode.Uri.parse(`${loginEndpointUrl}${tenant}/oauth2/v2.0/token`); + + const post = https.request({ + host: tokenUrl.authority, + path: tokenUrl.path, + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': postData.length + } + }, result => { + const buffer: Buffer[] = []; + result.on('data', (chunk: Buffer) => { + buffer.push(chunk); + }); + result.on('end', () => { + if (result.statusCode === 200) { + Logger.info('Exchanging login code for token success'); + resolve(this.getTokenFromResponse(buffer, scope)); + } else { + Logger.error('Exchanging login code for token failed'); + reject(new Error('Unable to login.')); + } + }); + }); + + post.write(postData); + + post.end(); + post.on('error', err => { + reject(err); + }); + + } catch (e) { + Logger.error(e.message); + reject(e); + } + }); + } + + private async refreshToken(refreshToken: string, scope: string): Promise { + return new Promise((resolve: (value: IToken) => void, reject) => { + Logger.info('Refreshing token...'); + const postData = querystring.stringify({ + refresh_token: refreshToken, + client_id: clientId, + grant_type: 'refresh_token', + scope: scope + }); + + const post = https.request({ + host: 'login.microsoftonline.com', + path: `/${tenant}/oauth2/v2.0/token`, + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': postData.length + } + }, result => { + const buffer: Buffer[] = []; + result.on('data', (chunk: Buffer) => { + buffer.push(chunk); + }); + result.on('end', async () => { + if (result.statusCode === 200) { + const token = this.getTokenFromResponse(buffer, scope); + this.setToken(token, scope); + Logger.info('Token refresh success'); + resolve(token); + } else { + Logger.error('Refreshing token failed'); + reject(new Error('Refreshing token failed.')); + } + }); + }); + + post.write(postData); + + post.end(); + post.on('error', err => { + Logger.error(err.message); + reject(err); + }); + }); + } + + public async logout(sessionId: string) { + Logger.info(`Logging out of session '${sessionId}'`); + const tokenIndex = this._tokens.findIndex(token => token.sessionId === sessionId); + if (tokenIndex > -1) { + this._tokens.splice(tokenIndex, 1); + } + + if (this._tokens.length === 0) { + await keychain.deleteToken(); + } else { + this.storeTokenData(); + } + + const timeout = this._refreshTimeouts.get(sessionId); + if (timeout) { + clearTimeout(timeout); + this._refreshTimeouts.delete(sessionId); + } + } + + public async clearSessions() { + Logger.info('Logging out of all sessions'); + this._tokens = []; + await keychain.deleteToken(); + + this._refreshTimeouts.forEach(timeout => { + clearTimeout(timeout); + }); + + this._refreshTimeouts.clear(); + } +} diff --git a/src/vs/platform/auth/electron-browser/authServer.ts b/extensions/vscode-account/src/authServer.ts similarity index 80% rename from src/vs/platform/auth/electron-browser/authServer.ts rename to extensions/vscode-account/src/authServer.ts index 57bd4fdfb5f..c75247e0a78 100644 --- a/src/vs/platform/auth/electron-browser/authServer.ts +++ b/extensions/vscode-account/src/authServer.ts @@ -7,14 +7,46 @@ import * as http from 'http'; import * as url from 'url'; import * as fs from 'fs'; import * as net from 'net'; -import { getPathFromAmdModule } from 'vs/base/common/amd'; -import { assertIsDefined } from 'vs/base/common/types'; +import * as path from 'path'; interface Deferred { resolve: (result: T | Promise) => void; reject: (reason: any) => void; } +const _typeof = { + number: 'number', + string: 'string', + undefined: 'undefined', + object: 'object', + function: 'function' +}; + +/** + * @returns whether the provided parameter is undefined. + */ +export function isUndefined(obj: any): obj is undefined { + return typeof (obj) === _typeof.undefined; +} + +/** + * @returns whether the provided parameter is undefined or null. + */ +export function isUndefinedOrNull(obj: any): obj is undefined | null { + return isUndefined(obj) || obj === null; +} + +/** + * Asserts that the argument passed in is neither undefined nor null. + */ +export function assertIsDefined(arg: T | null | undefined): T { + if (isUndefinedOrNull(arg)) { + throw new Error('Assertion Failed: argument is undefined or null'); + } + + return arg; +} + export function createTerminateServer(server: http.Server) { const sockets: Record = {}; let socketCount = 0; @@ -55,8 +87,8 @@ export async function startServer(server: http.Server): Promise { } }); - server.on('error', err => { - reject(err); + server.on('error', _ => { + reject(new Error('Error listening to server')); }); server.on('close', () => { @@ -140,10 +172,10 @@ export function createServer(nonce: string) { } break; case '/': - sendFile(res, getPathFromAmdModule(require, '../common/auth.html'), 'text/html; charset=utf-8'); + sendFile(res, path.join(__dirname, '../media/auth.html'), 'text/html; charset=utf-8'); break; case '/auth.css': - sendFile(res, getPathFromAmdModule(require, '../common/auth.css'), 'text/css; charset=utf-8'); + sendFile(res, path.join(__dirname, '../media/auth.css'), 'text/css; charset=utf-8'); break; case '/callback': deferredCode.resolve(callback(nonce, reqUrl) diff --git a/extensions/vscode-account/src/extension.ts b/extensions/vscode-account/src/extension.ts new file mode 100644 index 00000000000..83988aa7c18 --- /dev/null +++ b/extensions/vscode-account/src/extension.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'; +import { AzureActiveDirectoryService, onDidChangeSessions } from './AADHelper'; + +export async function activate(context: vscode.ExtensionContext) { + + const loginService = new AzureActiveDirectoryService(); + + await loginService.initialize(); + + vscode.authentication.registerAuthenticationProvider({ + id: 'MSA', + displayName: 'Microsoft', + onDidChangeSessions: onDidChangeSessions.event, + getSessions: () => Promise.resolve(loginService.sessions), + login: async (scopes: string[]) => { + try { + await loginService.login(scopes.sort().join(' ')); + return loginService.sessions[0]!; + } catch (e) { + vscode.window.showErrorMessage(`Logging in failed: ${e}`); + throw e; + } + }, + logout: async (id: string) => { + return loginService.logout(id); + } + }); + + return; +} + +// this method is called when your extension is deactivated +export function deactivate() { } diff --git a/extensions/vscode-account/src/keychain.ts b/extensions/vscode-account/src/keychain.ts new file mode 100644 index 00000000000..28cd962a2ab --- /dev/null +++ b/extensions/vscode-account/src/keychain.ts @@ -0,0 +1,67 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +// keytar depends on a native module shipped in vscode, so this is +// how we load it +import * as keytarType from 'keytar'; +import { env } from 'vscode'; + +function getKeytar(): Keytar | undefined { + try { + return require('keytar'); + } catch (err) { + console.log(err); + } + + return undefined; +} + +export type Keytar = { + getPassword: typeof keytarType['getPassword']; + setPassword: typeof keytarType['setPassword']; + deletePassword: typeof keytarType['deletePassword']; +}; + +const SERVICE_ID = `${env.uriScheme}-vscode.login`; +const ACCOUNT_ID = 'account'; + +export class Keychain { + private keytar: Keytar; + + constructor() { + const keytar = getKeytar(); + if (!keytar) { + throw new Error('System keychain unavailable'); + } + + this.keytar = keytar; + } + + async setToken(token: string): Promise { + try { + return await this.keytar.setPassword(SERVICE_ID, ACCOUNT_ID, token); + } catch (e) { + // Ignore + } + } + + async getToken() { + try { + return await this.keytar.getPassword(SERVICE_ID, ACCOUNT_ID); + } catch (e) { + // Ignore + } + } + + async deleteToken() { + try { + return await this.keytar.deletePassword(SERVICE_ID, ACCOUNT_ID); + } catch (e) { + // Ignore + } + } +} + +export const keychain = new Keychain(); diff --git a/extensions/vscode-account/src/logger.ts b/extensions/vscode-account/src/logger.ts new file mode 100644 index 00000000000..7fdbff51432 --- /dev/null +++ b/extensions/vscode-account/src/logger.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 * as vscode from 'vscode'; + +type LogLevel = 'Trace' | 'Info' | 'Error'; + +class Log { + private output: vscode.OutputChannel; + + constructor() { + this.output = vscode.window.createOutputChannel('Account'); + } + + private data2String(data: any): string { + if (data instanceof Error) { + return data.stack || data.message; + } + if (data.success === false && data.message) { + return data.message; + } + return data.toString(); + } + + public info(message: string, data?: any): void { + this.logLevel('Info', message, data); + } + + public error(message: string, data?: any): void { + this.logLevel('Error', message, data); + } + + public logLevel(level: LogLevel, message: string, data?: any): void { + this.output.appendLine(`[${level} - ${this.now()}] ${message}`); + if (data) { + this.output.appendLine(this.data2String(data)); + } + } + + private now(): string { + const now = new Date(); + return padLeft(now.getUTCHours() + '', 2, '0') + + ':' + padLeft(now.getMinutes() + '', 2, '0') + + ':' + padLeft(now.getUTCSeconds() + '', 2, '0') + '.' + now.getMilliseconds(); + } +} + +function padLeft(s: string, n: number, pad = ' ') { + return pad.repeat(Math.max(0, n - s.length)) + s; +} + +const Logger = new Log(); +export default Logger; diff --git a/src/vs/workbench/common/viewPaneContainer.ts b/extensions/vscode-account/src/utils.ts similarity index 51% rename from src/vs/workbench/common/viewPaneContainer.ts rename to extensions/vscode-account/src/utils.ts index 0c8f841fd6e..164f2236221 100644 --- a/src/vs/workbench/common/viewPaneContainer.ts +++ b/extensions/vscode-account/src/utils.ts @@ -3,14 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAction, IActionViewItem } from 'vs/base/common/actions'; - -export interface IViewPaneContainer { - setVisible(visible: boolean): void; - isVisible(): boolean; - focus(): void; - getActions(): IAction[]; - getSecondaryActions(): IAction[]; - getActionViewItem(action: IAction): IActionViewItem | undefined; - saveState(): void; +export function toBase64UrlEncoding(base64string: string) { + return base64string.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); // Need to use base64url encoding } diff --git a/extensions/vscode-account/src/vscode.proposed.d.ts b/extensions/vscode-account/src/vscode.proposed.d.ts new file mode 100644 index 00000000000..d6ad851d3dd --- /dev/null +++ b/extensions/vscode-account/src/vscode.proposed.d.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. + *--------------------------------------------------------------------------------------------*/ + +/** + * This is the place for API experiments and proposals. + * These API are NOT stable and subject to change. They are only available in the Insiders + * distribution and CANNOT be used in published extensions. + * + * To test these API in local environment: + * - Use Insiders release of VS Code. + * - Add `"enableProposedApi": true` to your package.json. + * - Copy this file to your project. + */ + +declare module 'vscode' { + + export interface Session { + id: string; + accessToken: string; + displayName: string; + scopes: string[] + } + + export interface AuthenticationProvider { + readonly id: string; + readonly displayName: string; + readonly onDidChangeSessions: Event; + + /** + * Returns an array of current sessions. + */ + getSessions(): Promise>; + + /** + * Prompts a user to login. + */ + login(scopes: string[]): Promise; + logout(sessionId: string): Promise; + } + + export namespace authentication { + export function registerAuthenticationProvider(provider: AuthenticationProvider): Disposable; + + /** + * Fires with the provider id that was registered or unregistered. + */ + export const onDidRegisterAuthenticationProvider: Event; + export const onDidUnregisterAuthenticationProvider: Event; + + export const providers: ReadonlyArray; + } + + // #region Ben - extension auth flow (desktop+web) + + export namespace env { + + export function asExternalUri(target: Uri): Thenable + } +} diff --git a/extensions/vscode-account/tsconfig.json b/extensions/vscode-account/tsconfig.json new file mode 100644 index 00000000000..46be6dc9581 --- /dev/null +++ b/extensions/vscode-account/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "outDir": "out", + "lib": [ + "es6", + "es2016", + "dom" + ], + "typeRoots": [ + "node_modules/@types", + "src/typings" + ], + "sourceMap": true, + "rootDir": "src", + "strict": true, + "noImplicitAny": true + }, + "exclude": [ + "node_modules", + ".vscode-test" + ] +} diff --git a/extensions/vscode-account/yarn.lock b/extensions/vscode-account/yarn.lock new file mode 100644 index 00000000000..4fc295de4b9 --- /dev/null +++ b/extensions/vscode-account/yarn.lock @@ -0,0 +1,658 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" + integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== + dependencies: + "@babel/highlight" "^7.8.3" + +"@babel/highlight@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" + integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@types/keytar@^4.0.1": + version "4.4.2" + resolved "https://registry.yarnpkg.com/@types/keytar/-/keytar-4.4.2.tgz#49ef917d6cbb4f19241c0ab50cd35097b5729b32" + integrity sha512-xtQcDj9ruGnMwvSu1E2BH4SFa5Dv2PvSPd0CKEBLN5hEj/v5YpXJY+B6hAfuKIbvEomD7vJTc/P1s1xPNh2kRw== + dependencies: + keytar "*" + +"@types/node@^10.12.21": + version "10.17.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" + integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== + +"@types/vscode@^1.41.0": + version "1.41.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.41.0.tgz#b0d75920220f84e07093285e59180c0f11d336cd" + integrity sha512-7SfeY5u9jgiELwxyLB3z7l6l/GbN9CqpCQGkcRlB7tKRFBxzbz2PoBfGrLxI1vRfUCIq5+hg5vtDHExwq5j3+A== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +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" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + 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= + +bl@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-3.0.0.tgz#3611ec00579fd18561754360b21e9f784500ff88" + integrity sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A== + dependencies: + readable-stream "^3.0.1" + +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" + +builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +chalk@^2.0.0, chalk@^2.3.0: + 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" + +chownr@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142" + integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw== + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +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= + +commander@^2.12.1: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +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= + +console-control-strings@^1.0.0, 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 sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +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= + +decompress-response@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986" + integrity sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw== + dependencies: + mimic-response "^2.0.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== + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +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" + +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= + +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== + +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== + +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== + +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.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= + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.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@^7.1.1: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + 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" + +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-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + +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.3, 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.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +keytar@*: + version "5.0.0" + resolved "https://registry.yarnpkg.com/keytar/-/keytar-5.0.0.tgz#c89b6b7a4608fd7af633d9f8474b1a7eb97cbe6f" + integrity sha512-a5UheK59YOlJf9i+2Osaj/kkH6mK0RCHVMtJ84u6ZfbfRIbOJ/H4b5VlOF/LgNHF6s78dRSBzZnvIuPiBKv6wg== + dependencies: + nan "2.14.0" + prebuild-install "5.3.3" + +mimic-response@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.0.0.tgz#996a51c60adf12cb8a87d7fb8ef24c2f3d5ebb46" + integrity sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ== + +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" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +nan@2.14.0: + version "2.14.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + +napi-build-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.1.tgz#1381a0f92c39d66bf19852e7873432fc2123e508" + integrity sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA== + +node-abi@^2.7.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.13.0.tgz#e2f2ec444d0aca3ea1b3874b6de41d1665828f63" + integrity sha512-9HrZGFVTR5SOu3PZAnAY2hLO36aW1wmA+FDsVkr85BTST32TLCA1H/AEcatVRAsWLyXS3bqUDYCAjq5/QGuSTA== + dependencies: + semver "^5.4.1" + +noop-logger@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" + integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI= + +npmlog@^4.0.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +once@^1.3.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" + +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-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +prebuild-install@5.3.3: + version "5.3.3" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-5.3.3.tgz#ef4052baac60d465f5ba6bf003c9c1de79b9da8e" + integrity sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g== + dependencies: + detect-libc "^1.0.3" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.0" + mkdirp "^0.5.1" + napi-build-utils "^1.0.1" + node-abi "^2.7.0" + noop-logger "^0.1.1" + npmlog "^4.0.1" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^3.0.3" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" + which-pm-runs "^1.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== + +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@^2.0.6: + 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" + +readable-stream@^3.0.1, readable-stream@^3.1.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +resolve@^1.3.2: + version "1.14.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.2.tgz#dbf31d0fa98b1f29aa5169783b9c290cb865fea2" + integrity sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ== + dependencies: + path-parse "^1.0.6" + +safe-buffer@^5.0.1, safe-buffer@~5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +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== + +semver@^5.3.0, semver@^5.4.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +simple-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" + integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= + +simple-get@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3" + integrity sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA== + dependencies: + decompress-response "^4.2.0" + once "^1.3.1" + simple-concat "^1.0.0" + +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= + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.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" + +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-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.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= + +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.0.0" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.0.tgz#677700fc0c8b337a78bee3623fdc235f21d7afad" + integrity sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA== + dependencies: + chownr "^1.1.1" + mkdirp "^0.5.1" + pump "^3.0.0" + tar-stream "^2.0.0" + +tar-stream@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.0.tgz#d1aaa3661f05b38b5acc9b7020efdca5179a2cc3" + integrity sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw== + dependencies: + bl "^3.0.0" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +tslib@^1.8.0, tslib@^1.8.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + +tslint@^5.12.1: + version "5.20.1" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d" + integrity sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg== + dependencies: + "@babel/code-frame" "^7.0.0" + builtin-modules "^1.1.1" + chalk "^2.3.0" + commander "^2.12.1" + diff "^4.0.1" + glob "^7.1.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + mkdirp "^0.5.1" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.8.0" + tsutils "^2.29.0" + +tsutils@^2.29.0: + version "2.29.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" + integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== + dependencies: + tslib "^1.8.1" + +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" + +typescript@^3.7.4: + version "3.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19" + integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw== + +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= + +which-pm-runs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" + integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +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/vscode-api-tests/src/singlefolder-tests/window.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts index c2ec4f13681..620ce762632 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts @@ -146,16 +146,19 @@ suite('window namespace tests', () => { }); test('active editor not always correct... #49125', async function () { + const randomFile1 = await createRandomFile(); + const randomFile2 = await createRandomFile(); + const [docA, docB] = await Promise.all([ - workspace.openTextDocument(await createRandomFile()), - workspace.openTextDocument(await createRandomFile()), + workspace.openTextDocument(randomFile1), + workspace.openTextDocument(randomFile2) ]); for (let c = 0; c < 4; c++) { let editorA = await window.showTextDocument(docA, ViewColumn.One); - assert(window.activeTextEditor === editorA); + assert.equal(window.activeTextEditor, editorA); let editorB = await window.showTextDocument(docB, ViewColumn.Two); - assert(window.activeTextEditor === editorB); + assert.equal(window.activeTextEditor, editorB); } }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.event.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.event.test.ts index ea71c64485d..ce6274157a1 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.event.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.event.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import * as vscode from 'vscode'; -import { createRandomFile } from '../utils'; +import { createRandomFile, withLogDisabled } from '../utils'; suite('workspace-event', () => { @@ -66,7 +66,7 @@ suite('workspace-event', () => { assert.equal(baseDoc.getText(), 'HALLO_NEW'); }); - test('onWillCreate/onDidCreate, make changes, edit new file fails', async function () { + test('onWillCreate/onDidCreate, make changes, edit new file fails', withLogDisabled(async function () { const base = await createRandomFile(); @@ -86,7 +86,7 @@ suite('workspace-event', () => { assert.equal((await vscode.workspace.fs.readFile(newUri)).toString(), ''); assert.equal((await vscode.workspace.openTextDocument(newUri)).getText(), ''); - }); + })); test('onWillDelete/onDidDelete', async function () { diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.fs.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.fs.test.ts index 7d552df04a8..f3c69fbbe67 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.fs.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.fs.test.ts @@ -140,4 +140,42 @@ suite('workspace-fs', () => { assert.equal(e.name, vscode.FileSystemError.Unavailable().name); } }); + + test('vscode.workspace.fs.remove() (and copy()) succeed unexpectedly. #84177', async function () { + const entries = await vscode.workspace.fs.readDirectory(root); + assert.ok(entries.length > 0); + + const someFolder = root.with({ path: posix.join(root.path, '6b1f9d664a92') }); + + try { + await vscode.workspace.fs.delete(someFolder, { recursive: true }); + assert.ok(false); + } catch (err) { + assert.ok(true); + } + }); + + test('vscode.workspace.fs.remove() (and copy()) succeed unexpectedly. #84177', async function () { + const entries = await vscode.workspace.fs.readDirectory(root); + assert.ok(entries.length > 0); + + const folder = root.with({ path: posix.join(root.path, 'folder') }); + const file = root.with({ path: posix.join(root.path, 'folder/file') }); + + await vscode.workspace.fs.createDirectory(folder); + await vscode.workspace.fs.writeFile(file, Buffer.from('FOO')); + + const someFolder = root.with({ path: posix.join(root.path, '6b1f9d664a92/a564c52da70a') }); + + try { + await vscode.workspace.fs.copy(folder, someFolder, { overwrite: true }); + assert.ok(true); + } catch (err) { + assert.ok(false, err); + + } finally { + await vscode.workspace.fs.delete(folder, { recursive: true, useTrash: false }); + await vscode.workspace.fs.delete(someFolder, { recursive: true, useTrash: false }); + } + }); }); 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 6e409489af6..abe883aa72e 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import * as vscode from 'vscode'; -import { createRandomFile, deleteFile, closeAllEditors, pathEquals, rndName, disposeAll, testFs, delay } from '../utils'; +import { createRandomFile, deleteFile, closeAllEditors, pathEquals, rndName, disposeAll, testFs, delay, withLogDisabled } from '../utils'; import { join, posix, basename } from 'path'; import * as fs from 'fs'; @@ -75,8 +75,8 @@ suite('workspace-namespace', () => { }); }); - test('openTextDocument, untitled is dirty', function () { - return vscode.workspace.openTextDocument(vscode.Uri.parse('untitled:' + join(vscode.workspace.workspaceFolders![0].uri.toString() || '', './newfile.txt'))).then(doc => { + test('openTextDocument, untitled is dirty', async function () { + return vscode.workspace.openTextDocument(vscode.workspace.workspaceFolders![0].uri.with({ scheme: 'untitled', path: posix.join(vscode.workspace.workspaceFolders![0].uri.path, 'newfile.txt') })).then(doc => { assert.equal(doc.uri.scheme, 'untitled'); assert.ok(doc.isDirty); }); @@ -598,7 +598,7 @@ suite('workspace-namespace', () => { assert.equal(doc.isDirty, true); }); - test('applyEdit should fail when editing deleted resource', async () => { + test('applyEdit should fail when editing deleted resource', withLogDisabled(async () => { const resource = await createRandomFile(); const edit = new vscode.WorkspaceEdit(); @@ -607,9 +607,9 @@ suite('workspace-namespace', () => { let success = await vscode.workspace.applyEdit(edit); assert.equal(success, false); - }); + })); - test('applyEdit should fail when renaming deleted resource', async () => { + test('applyEdit should fail when renaming deleted resource', withLogDisabled(async () => { const resource = await createRandomFile(); const edit = new vscode.WorkspaceEdit(); @@ -618,9 +618,9 @@ suite('workspace-namespace', () => { let success = await vscode.workspace.applyEdit(edit); assert.equal(success, false); - }); + })); - test('applyEdit should fail when editing renamed from resource', async () => { + test('applyEdit should fail when editing renamed from resource', withLogDisabled(async () => { const resource = await createRandomFile(); const newResource = vscode.Uri.file(resource.fsPath + '.1'); const edit = new vscode.WorkspaceEdit(); @@ -629,7 +629,7 @@ suite('workspace-namespace', () => { let success = await vscode.workspace.applyEdit(edit); assert.equal(success, false); - }); + })); test('applyEdit "edit A -> rename A to B -> edit B"', async () => { await testEditRenameEdit(oldUri => oldUri.with({ path: oldUri.path + 'NEW' })); @@ -662,7 +662,7 @@ suite('workspace-namespace', () => { return uri.with({ path: posix.join(posix.dirname(uri.path), `_${posix.basename(uri.path)}`) }); } - test('WorkspaceEdit: applying edits before and after rename duplicates resource #42633', async function () { + test('WorkspaceEdit: applying edits before and after rename duplicates resource #42633', withLogDisabled(async function () { let docUri = await createRandomFile(); let newUri = nameWithUnderscore(docUri); @@ -675,9 +675,9 @@ suite('workspace-namespace', () => { assert.ok(await vscode.workspace.applyEdit(we)); let doc = await vscode.workspace.openTextDocument(newUri); assert.equal(doc.getText(), 'BarHelloFoo'); - }); + })); - test('WorkspaceEdit: Problem recreating a renamed resource #42634', async function () { + test('WorkspaceEdit: Problem recreating a renamed resource #42634', withLogDisabled(async function () { let docUri = await createRandomFile(); let newUri = nameWithUnderscore(docUri); @@ -695,9 +695,9 @@ suite('workspace-namespace', () => { assert.equal(newDoc.getText(), 'HelloFoo'); let doc = await vscode.workspace.openTextDocument(docUri); assert.equal(doc.getText(), 'Bar'); - }); + })); - test('WorkspaceEdit api - after saving a deleted file, it still shows up as deleted. #42667', async function () { + test('WorkspaceEdit api - after saving a deleted file, it still shows up as deleted. #42667', withLogDisabled(async function () { let docUri = await createRandomFile(); let we = new vscode.WorkspaceEdit(); we.deleteFile(docUri); @@ -710,7 +710,7 @@ suite('workspace-namespace', () => { } catch (e) { assert.ok(true); } - }); + })); test('WorkspaceEdit: edit and rename parent folder duplicates resource #42641', async function () { @@ -741,7 +741,7 @@ suite('workspace-namespace', () => { assert.equal(doc.getText(), 'Hello'); }); - test('WorkspaceEdit: rename resource followed by edit does not work #42638', async function () { + test('WorkspaceEdit: rename resource followed by edit does not work #42638', withLogDisabled(async function () { let docUri = await createRandomFile(); let newUri = nameWithUnderscore(docUri); @@ -753,9 +753,9 @@ suite('workspace-namespace', () => { let doc = await vscode.workspace.openTextDocument(newUri); assert.equal(doc.getText(), 'Hello'); - }); + })); - test('WorkspaceEdit: create & override', async function () { + test('WorkspaceEdit: create & override', withLogDisabled(async function () { let docUri = await createRandomFile('before'); @@ -768,9 +768,9 @@ suite('workspace-namespace', () => { we.createFile(docUri, { overwrite: true }); assert.ok(await vscode.workspace.applyEdit(we)); assert.equal((await vscode.workspace.openTextDocument(docUri)).getText(), ''); - }); + })); - test('WorkspaceEdit: create & ignoreIfExists', async function () { + test('WorkspaceEdit: create & ignoreIfExists', withLogDisabled(async function () { let docUri = await createRandomFile('before'); let we = new vscode.WorkspaceEdit(); @@ -782,9 +782,9 @@ suite('workspace-namespace', () => { we.createFile(docUri, { overwrite: true, ignoreIfExists: true }); assert.ok(await vscode.workspace.applyEdit(we)); assert.equal((await vscode.workspace.openTextDocument(docUri)).getText(), ''); - }); + })); - test('WorkspaceEdit: rename & ignoreIfExists', async function () { + test('WorkspaceEdit: rename & ignoreIfExists', withLogDisabled(async function () { let aUri = await createRandomFile('aaa'); let bUri = await createRandomFile('bbb'); @@ -803,9 +803,9 @@ suite('workspace-namespace', () => { we = new vscode.WorkspaceEdit(); we.renameFile(aUri, bUri, { overwrite: true, ignoreIfExists: true }); assert.ok(await vscode.workspace.applyEdit(we)); - }); + })); - test('WorkspaceEdit: delete & ignoreIfNotExists', async function () { + test('WorkspaceEdit: delete & ignoreIfNotExists', withLogDisabled(async function () { let docUri = await createRandomFile(); let we = new vscode.WorkspaceEdit(); @@ -819,7 +819,7 @@ suite('workspace-namespace', () => { we = new vscode.WorkspaceEdit(); we.deleteFile(docUri, { ignoreIfNotExists: true }); assert.ok(await vscode.workspace.applyEdit(we)); - }); + })); test('WorkspaceEdit: insert & rename multiple', async function () { diff --git a/extensions/vscode-api-tests/src/utils.ts b/extensions/vscode-api-tests/src/utils.ts index 969a7cd0051..e270cd73adf 100644 --- a/extensions/vscode-api-tests/src/utils.ts +++ b/extensions/vscode-api-tests/src/utils.ts @@ -46,7 +46,6 @@ export function pathEquals(path1: string, path2: string): boolean { export function closeAllEditors(): Thenable { return vscode.commands.executeCommand('workbench.action.closeAllEditors'); - } export function disposeAll(disposables: vscode.Disposable[]) { @@ -71,3 +70,16 @@ function isTestTypeActive(): boolean { export function delay(ms: number) { return new Promise(resolve => setTimeout(resolve, ms)); } + +export function withLogDisabled(runnable: () => Promise): () => Promise { + return async (): Promise => { + const logLevel = await vscode.commands.executeCommand('_extensionTests.getLogLevel'); + await vscode.commands.executeCommand('_extensionTests.setLogLevel', 6 /* critical */); + + try { + await runnable(); + } finally { + await vscode.commands.executeCommand('_extensionTests.setLogLevel', logLevel); + } + }; +} diff --git a/extensions/vscode-colorize-tests/src/colorizerTestMain.ts b/extensions/vscode-colorize-tests/src/colorizerTestMain.ts index 9586fc0bb97..a014275a7e6 100644 --- a/extensions/vscode-colorize-tests/src/colorizerTestMain.ts +++ b/extensions/vscode-colorize-tests/src/colorizerTestMain.ts @@ -15,8 +15,8 @@ export function activate(context: vscode.ExtensionContext): any { const outputChannel = vscode.window.createOutputChannel('Semantic Tokens Test'); - const semanticHighlightProvider: vscode.SemanticTokensProvider = { - provideSemanticTokens(document: vscode.TextDocument): vscode.ProviderResult { + const documentSemanticHighlightProvider: vscode.DocumentSemanticTokensProvider = { + provideDocumentSemanticTokens(document: vscode.TextDocument): vscode.ProviderResult { const builder = new vscode.SemanticTokensBuilder(); function addToken(value: string, startLine: number, startCharacter: number, length: number) { @@ -61,6 +61,6 @@ export function activate(context: vscode.ExtensionContext): any { }; - context.subscriptions.push(vscode.languages.registerSemanticTokensProvider({ pattern: '**/*semantic-test.json' }, semanticHighlightProvider, legend)); + context.subscriptions.push(vscode.languages.registerDocumentSemanticTokensProvider({ pattern: '**/*semantic-test.json' }, documentSemanticHighlightProvider, legend)); } diff --git a/extensions/yaml/test/colorize-results/issue-4008_yaml.json b/extensions/yaml/test/colorize-results/issue-4008_yaml.json index 10329df780e..c16426c590f 100644 --- a/extensions/yaml/test/colorize-results/issue-4008_yaml.json +++ b/extensions/yaml/test/colorize-results/issue-4008_yaml.json @@ -257,10 +257,10 @@ "t": "source.yaml constant.numeric.integer.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } } -] \ No newline at end of file +] diff --git a/extensions/yaml/test/colorize-results/test_yaml.json b/extensions/yaml/test/colorize-results/test_yaml.json index 6c871b32208..258202824fe 100644 --- a/extensions/yaml/test/colorize-results/test_yaml.json +++ b/extensions/yaml/test/colorize-results/test_yaml.json @@ -246,9 +246,9 @@ "t": "source.yaml constant.numeric.float.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -774,9 +774,9 @@ "t": "source.yaml meta.flow-mapping.yaml meta.flow-pair.yaml meta.flow-pair.value.yaml constant.numeric.integer.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -906,9 +906,9 @@ "t": "source.yaml constant.numeric.integer.yaml", "r": { "dark_plus": "constant.numeric: #B5CEA8", - "light_plus": "constant.numeric: #09885A", + "light_plus": "constant.numeric: #098658", "dark_vs": "constant.numeric: #B5CEA8", - "light_vs": "constant.numeric: #09885A", + "light_vs": "constant.numeric: #098658", "hc_black": "constant.numeric: #B5CEA8" } }, @@ -1132,4 +1132,4 @@ "hc_black": "string: #CE9178" } } -] \ No newline at end of file +] diff --git a/extensions/yarn.lock b/extensions/yarn.lock index a8eb51df657..dc1fa7c2de8 100644 --- a/extensions/yarn.lock +++ b/extensions/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -typescript@3.7.3: - version "3.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69" - integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== +typescript@3.7.5: + version "3.7.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" + integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== diff --git a/package.json b/package.json index aa000ded9df..be5c947477a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.42.0", - "distro": "683b7a48a0cab9871ae34d129cc31e1036746b37", + "distro": "37cc2dc2461194a03cadbd9de5030ac3b6eb1109", "author": { "name": "Microsoft Corporation" }, @@ -41,7 +41,7 @@ "jschardet": "2.1.1", "keytar": "^4.11.0", "native-is-elevated": "0.4.1", - "native-keymap": "2.1.0", + "native-keymap": "2.1.1", "native-watchdog": "1.3.0", "node-pty": "^0.10.0-beta2", "onigasm-umd": "2.2.5", @@ -121,11 +121,11 @@ "husky": "^0.13.1", "innosetup": "5.6.1", "is": "^3.1.0", - "istanbul-lib-coverage": "^2.0.5", - "istanbul-lib-instrument": "^3.3.0", - "istanbul-lib-report": "^2.0.8", - "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^2.2.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.0", "jsdom-no-contextify": "^3.1.0", "lazy.js": "^0.4.2", "merge-options": "^1.0.1", @@ -144,7 +144,7 @@ "sinon": "^1.17.2", "source-map": "^0.4.4", "ts-loader": "^4.4.2", - "typescript": "^3.8.0-dev.20200108", + "typescript": "3.8.0-beta", "typescript-formatter": "7.1.0", "underscore": "^1.8.2", "vinyl": "^2.0.0", diff --git a/scripts/test-integration.bat b/scripts/test-integration.bat index 946cf383914..695f1c940fe 100644 --- a/scripts/test-integration.bat +++ b/scripts/test-integration.bat @@ -23,6 +23,11 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" ( call yarn gulp compile-extension:html-language-features-server call yarn gulp compile-extension:json-language-features-server + :: Configuration for more verbose output + set VSCODE_CLI=1 + set ELECTRON_ENABLE_LOGGING=1 + set ELECTRON_ENABLE_STACK_DUMPING=1 + echo "Running integration tests with '%INTEGRATION_TEST_ELECTRON_PATH%' as build." ) diff --git a/scripts/test-integration.sh b/scripts/test-integration.sh index 21652b632cf..89851e48908 100755 --- a/scripts/test-integration.sh +++ b/scripts/test-integration.sh @@ -30,6 +30,11 @@ else yarn gulp compile-extension:html-language-features-server yarn gulp compile-extension:json-language-features-server + # Configuration for more verbose output + export VSCODE_CLI=1 + export ELECTRON_ENABLE_STACK_DUMPING=1 + export ELECTRON_ENABLE_LOGGING=1 + echo "Running integration tests with '$INTEGRATION_TEST_ELECTRON_PATH' as build." fi @@ -42,7 +47,6 @@ fi "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/markdown-language-features/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/markdown-language-features --extensionTestsPath=$ROOT/extensions/markdown-language-features/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR - mkdir -p $ROOT/extensions/emmet/test-fixtures "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR rm -rf $ROOT/extensions/emmet/test-fixtures diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index b7a55a4ca64..4c2d05b208e 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -287,7 +287,7 @@ export function addDisposableGenericMouseUpListner(node: EventTarget, handler: ( export function addDisposableNonBubblingMouseOutListener(node: Element, handler: (event: MouseEvent) => void): IDisposable { return addDisposableListener(node, 'mouseout', (e: MouseEvent) => { // Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements - let toElement: Node | null = (e.relatedTarget || e.target); + let toElement: Node | null = (e.relatedTarget); while (toElement && toElement !== node) { toElement = toElement.parentNode; } @@ -302,7 +302,7 @@ export function addDisposableNonBubblingMouseOutListener(node: Element, handler: export function addDisposableNonBubblingPointerOutListener(node: Element, handler: (event: MouseEvent) => void): IDisposable { return addDisposableListener(node, 'pointerout', (e: MouseEvent) => { // Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements - let toElement: Node | null = (e.relatedTarget || e.target); + let toElement: Node | null = (e.relatedTarget); while (toElement && toElement !== node) { toElement = toElement.parentNode; } @@ -628,11 +628,17 @@ export function getTopLeftOffset(element: HTMLElement): { left: number; top: num // Adapted from WinJS.Utilities.getPosition // and added borders to the mix - let offsetParent = element.offsetParent, top = element.offsetTop, left = element.offsetLeft; + let offsetParent = element.offsetParent; + let top = element.offsetTop; + let left = element.offsetLeft; - while ((element = element.parentNode) !== null && element !== document.body && element !== document.documentElement) { + while ( + (element = element.parentNode) !== null + && element !== document.body + && element !== document.documentElement + ) { top -= element.scrollTop; - let c = getComputedStyle(element); + const c = isShadowRoot(element) ? null : getComputedStyle(element); if (c) { left -= c.direction !== 'rtl' ? element.scrollLeft : -element.scrollLeft; } @@ -793,7 +799,7 @@ export function isAncestor(testChild: Node | null, testAncestor: Node | null): b } export function findParentWithClass(node: HTMLElement, clazz: string, stopAtClazzOrNode?: string | HTMLElement): HTMLElement | null { - while (node) { + while (node && node.nodeType === node.ELEMENT_NODE) { if (hasClass(node, clazz)) { return node; } @@ -820,6 +826,27 @@ export function hasParentWithClass(node: HTMLElement, clazz: string, stopAtClazz return !!findParentWithClass(node, clazz, stopAtClazzOrNode); } +export function isShadowRoot(node: Node): node is ShadowRoot { + return ( + node && !!(node).host && !!(node).mode + ); +} + +export function isInShadowDOM(domNode: Node): boolean { + return !!getShadowRoot(domNode); +} + +export function getShadowRoot(domNode: Node): ShadowRoot | null { + while (domNode.parentNode) { + if (domNode === document.body) { + // reached the body + return null; + } + domNode = domNode.parentNode; + } + return isShadowRoot(domNode) ? domNode : null; +} + export function createStyleSheet(container: HTMLElement = document.getElementsByTagName('head')[0]): HTMLStyleElement { let style = document.createElement('style'); style.type = 'text/css'; @@ -1167,7 +1194,7 @@ export function hide(...elements: HTMLElement[]): void { } function findParentWithAttribute(node: Node | null, attribute: string): HTMLElement | null { - while (node) { + while (node && node.nodeType === node.ELEMENT_NODE) { if (node instanceof HTMLElement && node.hasAttribute(attribute)) { return node; } diff --git a/src/vs/base/browser/fastDomNode.ts b/src/vs/base/browser/fastDomNode.ts index 5c688bd3496..12886f27e79 100644 --- a/src/vs/base/browser/fastDomNode.ts +++ b/src/vs/base/browser/fastDomNode.ts @@ -25,6 +25,7 @@ export class FastDomNode { private _display: string; private _position: string; private _visibility: string; + private _backgroundColor: string; private _layerHint: boolean; private _contain: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'style' | 'paint'; @@ -47,6 +48,7 @@ export class FastDomNode { this._display = ''; this._position = ''; this._visibility = ''; + this._backgroundColor = ''; this._layerHint = false; this._contain = 'none'; } @@ -200,6 +202,14 @@ export class FastDomNode { this.domNode.style.visibility = this._visibility; } + public setBackgroundColor(backgroundColor: string): void { + if (this._backgroundColor === backgroundColor) { + return; + } + this._backgroundColor = backgroundColor; + this.domNode.style.backgroundColor = this._backgroundColor; + } + public setLayerHinting(layerHint: boolean): void { if (this._layerHint === layerHint) { return; diff --git a/src/vs/base/browser/globalMouseMoveMonitor.ts b/src/vs/base/browser/globalMouseMoveMonitor.ts index c3c71d44fcb..328ecaee03d 100644 --- a/src/vs/base/browser/globalMouseMoveMonitor.ts +++ b/src/vs/base/browser/globalMouseMoveMonitor.ts @@ -12,6 +12,7 @@ import { BrowserFeatures } from 'vs/base/browser/canIUse'; export interface IStandardMouseMoveEventData { leftButton: boolean; + buttons: number; posx: number; posy: number; } @@ -33,21 +34,22 @@ export function standardMouseMoveMerger(lastEvent: IStandardMouseMoveEventData | ev.preventDefault(); return { leftButton: ev.leftButton, + buttons: ev.buttons, posx: ev.posx, posy: ev.posy }; } -export class GlobalMouseMoveMonitor implements IDisposable { +export class GlobalMouseMoveMonitor implements IDisposable { - protected readonly hooks = new DisposableStore(); - protected mouseMoveEventMerger: IEventMerger | null = null; - protected mouseMoveCallback: IMouseMoveCallback | null = null; - protected onStopCallback: IOnStopCallback | null = null; + private readonly _hooks = new DisposableStore(); + private _mouseMoveEventMerger: IEventMerger | null = null; + private _mouseMoveCallback: IMouseMoveCallback | null = null; + private _onStopCallback: IOnStopCallback | null = null; public dispose(): void { this.stopMonitoring(false); - this.hooks.dispose(); + this._hooks.dispose(); } public stopMonitoring(invokeStopCallback: boolean): void { @@ -57,11 +59,11 @@ export class GlobalMouseMoveMonitor implements IDisposable { } // Unhook - this.hooks.clear(); - this.mouseMoveEventMerger = null; - this.mouseMoveCallback = null; - const onStopCallback = this.onStopCallback; - this.onStopCallback = null; + this._hooks.clear(); + this._mouseMoveEventMerger = null; + this._mouseMoveCallback = null; + const onStopCallback = this._onStopCallback; + this._onStopCallback = null; if (invokeStopCallback && onStopCallback) { onStopCallback(); @@ -69,10 +71,12 @@ export class GlobalMouseMoveMonitor implements IDisposable { } public isMonitoring(): boolean { - return !!this.mouseMoveEventMerger; + return !!this._mouseMoveEventMerger; } public startMonitoring( + initialElement: HTMLElement, + initialButtons: number, mouseMoveEventMerger: IEventMerger, mouseMoveCallback: IMouseMoveCallback, onStopCallback: IOnStopCallback @@ -81,40 +85,54 @@ export class GlobalMouseMoveMonitor implements IDisposable { // I am already hooked return; } - this.mouseMoveEventMerger = mouseMoveEventMerger; - this.mouseMoveCallback = mouseMoveCallback; - this.onStopCallback = onStopCallback; + this._mouseMoveEventMerger = mouseMoveEventMerger; + this._mouseMoveCallback = mouseMoveCallback; + this._onStopCallback = onStopCallback; - let windowChain = IframeUtils.getSameOriginWindowChain(); + const windowChain = IframeUtils.getSameOriginWindowChain(); const mouseMove = platform.isIOS && BrowserFeatures.pointerEvents ? 'pointermove' : 'mousemove'; const mouseUp = platform.isIOS && BrowserFeatures.pointerEvents ? 'pointerup' : 'mouseup'; - for (const element of windowChain) { - this.hooks.add(dom.addDisposableThrottledListener(element.window.document, mouseMove, - (data: R) => this.mouseMoveCallback!(data), - (lastEvent: R | null, currentEvent) => this.mouseMoveEventMerger!(lastEvent, currentEvent as MouseEvent) + + const listenTo: (Document | ShadowRoot)[] = windowChain.map(element => element.window.document); + const shadowRoot = dom.getShadowRoot(initialElement); + if (shadowRoot) { + listenTo.unshift(shadowRoot); + } + + for (const element of listenTo) { + this._hooks.add(dom.addDisposableThrottledListener(element, mouseMove, + (data: R) => { + if (data.buttons !== initialButtons) { + // Buttons state has changed in the meantime + this.stopMonitoring(true); + return; + } + this._mouseMoveCallback!(data); + }, + (lastEvent: R | null, currentEvent) => this._mouseMoveEventMerger!(lastEvent, currentEvent as MouseEvent) )); - this.hooks.add(dom.addDisposableListener(element.window.document, mouseUp, (e: MouseEvent) => this.stopMonitoring(true))); + this._hooks.add(dom.addDisposableListener(element, mouseUp, (e: MouseEvent) => this.stopMonitoring(true))); } if (IframeUtils.hasDifferentOriginAncestor()) { let lastSameOriginAncestor = windowChain[windowChain.length - 1]; // We might miss a mouse up if it happens outside the iframe // This one is for Chrome - this.hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseout', (browserEvent: MouseEvent) => { + this._hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseout', (browserEvent: MouseEvent) => { let e = new StandardMouseEvent(browserEvent); if (e.target.tagName.toLowerCase() === 'html') { this.stopMonitoring(true); } })); // This one is for FF - this.hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseover', (browserEvent: MouseEvent) => { + this._hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseover', (browserEvent: MouseEvent) => { let e = new StandardMouseEvent(browserEvent); if (e.target.tagName.toLowerCase() === 'html') { this.stopMonitoring(true); } })); // This one is for IE - this.hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document.body, 'mouseleave', (browserEvent: MouseEvent) => { + this._hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document.body, 'mouseleave', (browserEvent: MouseEvent) => { this.stopMonitoring(true); })); } diff --git a/src/vs/base/browser/mouseEvent.ts b/src/vs/base/browser/mouseEvent.ts index f3f2089100b..25e73b113d6 100644 --- a/src/vs/base/browser/mouseEvent.ts +++ b/src/vs/base/browser/mouseEvent.ts @@ -12,6 +12,7 @@ export interface IMouseEvent { readonly leftButton: boolean; readonly middleButton: boolean; readonly rightButton: boolean; + readonly buttons: number; readonly target: HTMLElement; readonly detail: number; readonly posx: number; @@ -33,6 +34,7 @@ export class StandardMouseEvent implements IMouseEvent { public readonly leftButton: boolean; public readonly middleButton: boolean; public readonly rightButton: boolean; + public readonly buttons: number; public readonly target: HTMLElement; public detail: number; public readonly posx: number; @@ -49,6 +51,7 @@ export class StandardMouseEvent implements IMouseEvent { this.leftButton = e.button === 0; this.middleButton = e.button === 1; this.rightButton = e.button === 2; + this.buttons = e.buttons; this.target = e.target; diff --git a/src/vs/base/browser/ui/codiconLabel/codicon/codicon.css b/src/vs/base/browser/ui/codiconLabel/codicon/codicon.css index a8060769041..c017682c7f6 100644 --- a/src/vs/base/browser/ui/codiconLabel/codicon/codicon.css +++ b/src/vs/base/browser/ui/codiconLabel/codicon/codicon.css @@ -5,7 +5,7 @@ @font-face { font-family: "codicon"; - src: url("./codicon.ttf?ed926e87ee4e27771159d875e877f74a") format("truetype"); + src: url("./codicon.ttf?be537a78617db0869caa4b4cc683a24a") format("truetype"); } .codicon[class*='codicon-'] { @@ -119,6 +119,7 @@ .codicon-github:before { content: "\ea84" } .codicon-terminal:before { content: "\ea85" } .codicon-console:before { content: "\ea85" } +.codicon-repl:before { content: "\ea85" } .codicon-zap:before { content: "\ea86" } .codicon-symbol-event:before { content: "\ea86" } .codicon-error:before { content: "\ea87" } @@ -410,4 +411,6 @@ .codicon-menu:before { content: "\eb94" } .codicon-expand-all:before { content: "\eb95" } .codicon-feedback:before { content: "\eb96" } +.codicon-group-by-ref-type:before { content: "\eb97" } +.codicon-ungroup-by-ref-type:before { content: "\eb98" } .codicon-debug-alt:before { content: "\f101" } diff --git a/src/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf b/src/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf index aae19797fbc..90ace76ff74 100644 Binary files a/src/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf and b/src/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf differ diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index 88716fd28d3..27222583608 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -392,6 +392,8 @@ class BranchNode implements ISplitView, IDisposable { const child = this._removeChild(from); this._addChild(child, to); + + this.onDidChildrenChange(); } swapChildren(from: number, to: number): void { @@ -408,6 +410,8 @@ class BranchNode implements ISplitView, IDisposable { this.splitview.swapViews(from, to); [this.children[from].orthogonalStartSash, this.children[from].orthogonalEndSash, this.children[to].orthogonalStartSash, this.children[to].orthogonalEndSash] = [this.children[to].orthogonalStartSash, this.children[to].orthogonalEndSash, this.children[from].orthogonalStartSash, this.children[from].orthogonalEndSash]; [this.children[from], this.children[to]] = [this.children[to], this.children[from]]; + + this.onDidChildrenChange(); } resizeChild(index: number, size: number): void { diff --git a/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts b/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts index 163dffb2d5a..e408f21afd2 100644 --- a/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts +++ b/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts @@ -10,6 +10,7 @@ import { escape } from 'vs/base/common/strings'; export interface IHighlight { start: number; end: number; + extraClasses?: string; } export class HighlightedLabel { @@ -69,7 +70,11 @@ export class HighlightedLabel { htmlContent += ''; pos = highlight.end; } - htmlContent += ''; + if (highlight.extraClasses) { + htmlContent += ``; + } else { + htmlContent += ``; + } const substring = this.text.substring(highlight.start, highlight.end); htmlContent += this.supportCodicons ? renderCodicons(escape(substring)) : escape(substring); htmlContent += ''; diff --git a/src/vs/base/browser/ui/iconLabel/iconLabel.ts b/src/vs/base/browser/ui/iconLabel/iconLabel.ts index 254aed56902..af06f86e2fa 100644 --- a/src/vs/base/browser/ui/iconLabel/iconLabel.ts +++ b/src/vs/base/browser/ui/iconLabel/iconLabel.ts @@ -92,8 +92,10 @@ class FastLabelNode { export class IconLabel extends Disposable { private domNode: FastLabelNode; - private descriptionContainer: FastLabelNode; + private nameNode: Label | LabelWithHighlights; + + private descriptionContainer: FastLabelNode; private descriptionNode: FastLabelNode | HighlightedLabel | undefined; private descriptionNodeFactory: () => FastLabelNode | HighlightedLabel; diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index 718d3381cd4..5f6e52d0c98 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -904,7 +904,7 @@ export class ListView implements ISpliceable, IDisposable { } // sanitize feedback list - feedback = distinct(feedback).filter(i => i >= -1 && i < this.length).sort(); + feedback = distinct(feedback).filter(i => i >= -1 && i < this.length).sort((a, b) => a - b); feedback = feedback[0] === -1 ? [-1] : feedback; if (equalsDragFeedback(this.currentDragFeedback, feedback)) { diff --git a/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts b/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts index b1d48bc7cf8..6658a8ceedd 100644 --- a/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts @@ -20,6 +20,7 @@ import { INewScrollPosition, Scrollable, ScrollbarVisibility } from 'vs/base/com const MOUSE_DRAG_RESET_DISTANCE = 140; export interface ISimplifiedMouseEvent { + buttons: number; posx: number; posy: number; } @@ -60,6 +61,7 @@ export abstract class AbstractScrollbar extends Widget { this._scrollable = opts.scrollable; this._scrollbarState = opts.scrollbarState; this._visibilityController = this._register(new ScrollbarVisibilityController(opts.visibility, 'visible scrollbar ' + opts.extraScrollbarClassName, 'invisible scrollbar ' + opts.extraScrollbarClassName)); + this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); this._mouseMoveMonitor = this._register(new GlobalMouseMoveMonitor()); this._shouldRender = true; this.domNode = createFastDomNode(document.createElement('div')); @@ -215,13 +217,15 @@ export abstract class AbstractScrollbar extends Widget { } } - private _sliderMouseDown(e: ISimplifiedMouseEvent, onDragFinished: () => void): void { + private _sliderMouseDown(e: IMouseEvent, onDragFinished: () => void): void { const initialMousePosition = this._sliderMousePosition(e); const initialMouseOrthogonalPosition = this._sliderOrthogonalMousePosition(e); const initialScrollbarState = this._scrollbarState.clone(); this.slider.toggleClassName('active', true); this._mouseMoveMonitor.startMonitoring( + e.target, + e.buttons, standardMouseMoveMerger, (mouseMoveData: IStandardMouseMoveEventData) => { const mouseOrthogonalPosition = this._sliderOrthogonalMousePosition(mouseMoveData); diff --git a/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts b/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts index 1c36edb215a..f68d4434b4d 100644 --- a/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts @@ -13,13 +13,18 @@ import { INewScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility } from export class HorizontalScrollbar extends AbstractScrollbar { constructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) { + const scrollDimensions = scrollable.getScrollDimensions(); + const scrollPosition = scrollable.getCurrentScrollPosition(); super({ lazyRender: options.lazyRender, host: host, scrollbarState: new ScrollbarState( (options.horizontalHasArrows ? options.arrowSize : 0), (options.horizontal === ScrollbarVisibility.Hidden ? 0 : options.horizontalScrollbarSize), - (options.vertical === ScrollbarVisibility.Hidden ? 0 : options.verticalScrollbarSize) + (options.vertical === ScrollbarVisibility.Hidden ? 0 : options.verticalScrollbarSize), + scrollDimensions.width, + scrollDimensions.scrollWidth, + scrollPosition.scrollLeft ), visibility: options.horizontal, extraScrollbarClassName: 'horizontal', diff --git a/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts b/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts index b174952d7ae..fcde58933bf 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts +++ b/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts @@ -93,6 +93,8 @@ export class ScrollbarArrow extends Widget { this._mousedownScheduleRepeatTimer.cancelAndSet(scheduleRepeater, 200); this._mouseMoveMonitor.startMonitoring( + e.target, + e.buttons, standardMouseMoveMerger, (mouseMoveData: IStandardMouseMoveEventData) => { /* Intentional empty */ diff --git a/src/vs/base/browser/ui/scrollbar/scrollbarState.ts b/src/vs/base/browser/ui/scrollbar/scrollbarState.ts index edde3f8d1ee..a3554658ecb 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollbarState.ts +++ b/src/vs/base/browser/ui/scrollbar/scrollbarState.ts @@ -62,14 +62,14 @@ export class ScrollbarState { private _computedSliderRatio: number; private _computedSliderPosition: number; - constructor(arrowSize: number, scrollbarSize: number, oppositeScrollbarSize: number) { + constructor(arrowSize: number, scrollbarSize: number, oppositeScrollbarSize: number, visibleSize: number, scrollSize: number, scrollPosition: number) { this._scrollbarSize = Math.round(scrollbarSize); this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize); this._arrowSize = Math.round(arrowSize); - this._visibleSize = 0; - this._scrollSize = 0; - this._scrollPosition = 0; + this._visibleSize = visibleSize; + this._scrollSize = scrollSize; + this._scrollPosition = scrollPosition; this._computedAvailableSize = 0; this._computedIsNeeded = false; @@ -81,11 +81,7 @@ export class ScrollbarState { } public clone(): ScrollbarState { - let r = new ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize); - r.setVisibleSize(this._visibleSize); - r.setScrollSize(this._scrollSize); - r.setScrollPosition(this._scrollPosition); - return r; + return new ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition); } public setVisibleSize(visibleSize: number): boolean { diff --git a/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts b/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts index 8c1bb82823f..c974029acc2 100644 --- a/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts @@ -13,6 +13,8 @@ import { INewScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility } from export class VerticalScrollbar extends AbstractScrollbar { constructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) { + const scrollDimensions = scrollable.getScrollDimensions(); + const scrollPosition = scrollable.getCurrentScrollPosition(); super({ lazyRender: options.lazyRender, host: host, @@ -20,7 +22,10 @@ export class VerticalScrollbar extends AbstractScrollbar { (options.verticalHasArrows ? options.arrowSize : 0), (options.vertical === ScrollbarVisibility.Hidden ? 0 : options.verticalScrollbarSize), // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom - 0 + 0, + scrollDimensions.height, + scrollDimensions.scrollHeight, + scrollPosition.scrollTop ), visibility: options.vertical, extraScrollbarClassName: 'vertical', diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 732edc52118..2b2ed1d052d 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -190,7 +190,13 @@ function asListOptions(modelProvider: () => ITreeModel { + return options.ariaProvider!.isChecked!(node.element); + } : undefined, + getRole: options.ariaProvider && options.ariaProvider.getRole ? (node) => { + return options.ariaProvider!.getRole!(node.element); + } : undefined } }; } diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 91a1f9ddf9d..3786e910663 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -258,7 +258,20 @@ function asObjectTreeOptions(options?: IAsyncDataTreeOpt e => (options.expandOnlyOnTwistieClick as ((e: T) => boolean))(e.element as T) ) ), - ariaProvider: undefined, + ariaProvider: options.ariaProvider && { + getPosInSet(el, index) { + return options.ariaProvider!.getPosInSet(el.element as T, index); + }, + getSetSize(el, index, listLength) { + return options.ariaProvider!.getSetSize(el.element as T, index, listLength); + }, + getRole: options.ariaProvider!.getRole ? (el) => { + return options.ariaProvider!.getRole!(el.element as T); + } : undefined, + isChecked: options.ariaProvider!.isChecked ? (e) => { + return options.ariaProvider?.isChecked!(e.element as T); + } : undefined + }, additionalScrollHeight: options.additionalScrollHeight }; } diff --git a/src/vs/base/common/amd.ts b/src/vs/base/common/amd.ts index 8aa520d20c1..b44b19ddd0d 100644 --- a/src/vs/base/common/amd.ts +++ b/src/vs/base/common/amd.ts @@ -6,7 +6,11 @@ import { URI } from 'vs/base/common/uri'; export function getPathFromAmdModule(requirefn: typeof require, relativePath: string): string { - return URI.parse(requirefn.toUrl(relativePath)).fsPath; + return getUriFromAmdModule(requirefn, relativePath).fsPath; +} + +export function getUriFromAmdModule(requirefn: typeof require, relativePath: string): URI { + return URI.parse(requirefn.toUrl(relativePath)); } /** diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts index 84b8acb7081..81c29e6731b 100644 --- a/src/vs/base/common/async.ts +++ b/src/vs/base/common/async.ts @@ -481,8 +481,9 @@ export class Queue extends Limiter { * A helper to organize queues per resource. The ResourceQueue makes sure to manage queues per resource * by disposing them once the queue is empty. */ -export class ResourceQueue { - private queues: Map> = new Map(); +export class ResourceQueue implements IDisposable { + + private readonly queues = new Map>(); queueFor(resource: URI): Queue { const key = resource.toString(); @@ -498,6 +499,11 @@ export class ResourceQueue { return this.queues.get(key)!; } + + dispose(): void { + this.queues.forEach(queue => queue.dispose()); + this.queues.clear(); + } } export class TimeoutTimer implements IDisposable { diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index f0492026239..49b7b449862 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -148,6 +148,7 @@ export namespace Event { if (leading && !handle) { emitter.fire(output); + output = undefined; } clearTimeout(handle); diff --git a/src/vs/base/common/jsonEdit.ts b/src/vs/base/common/jsonEdit.ts index a8542f24b2c..7fd05e5d2e1 100644 --- a/src/vs/base/common/jsonEdit.ts +++ b/src/vs/base/common/jsonEdit.ts @@ -120,7 +120,7 @@ export function setProperty(text: string, originalPath: JSONPath, value: any, fo } } -function withFormatting(text: string, edit: Edit, formattingOptions: FormattingOptions): Edit[] { +export function withFormatting(text: string, edit: Edit, formattingOptions: FormattingOptions): Edit[] { // apply the edit let newText = applyEdit(text, edit); diff --git a/src/vs/base/common/jsonFormatter.ts b/src/vs/base/common/jsonFormatter.ts index a25c493c05d..05852ef5fc5 100644 --- a/src/vs/base/common/jsonFormatter.ts +++ b/src/vs/base/common/jsonFormatter.ts @@ -228,7 +228,7 @@ function computeIndentLevel(content: string, options: FormattingOptions): number return Math.floor(nChars / tabSize); } -function getEOL(options: FormattingOptions, text: string): string { +export function getEOL(options: FormattingOptions, text: string): string { for (let i = 0; i < text.length; i++) { const ch = text.charAt(i); if (ch === '\r') { @@ -245,4 +245,4 @@ function getEOL(options: FormattingOptions, text: string): string { export function isEOL(text: string, offset: number) { return '\r\n'.indexOf(text.charAt(offset)) !== -1; -} \ No newline at end of file +} diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index 61d2436b045..4f6b55c3fe5 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -454,8 +454,8 @@ export class ResourceMap { return this.map.delete(this.toKey(resource)); } - forEach(clb: (value: T) => void): void { - this.map.forEach(clb); + forEach(clb: (value: T, key: URI) => void): void { + this.map.forEach((value, index) => clb(value, URI.parse(index))); } values(): T[] { diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts index 231180d513f..a68e020f9f1 100644 --- a/src/vs/base/common/network.ts +++ b/src/vs/base/common/network.ts @@ -12,47 +12,47 @@ export namespace Schemas { * A schema that is used for models that exist in memory * only and that have no correspondence on a server or such. */ - export const inMemory: string = 'inmemory'; + export const inMemory = 'inmemory'; /** * A schema that is used for setting files */ - export const vscode: string = 'vscode'; + export const vscode = 'vscode'; /** * A schema that is used for internal private files */ - export const internal: string = 'private'; + export const internal = 'private'; /** * A walk-through document. */ - export const walkThrough: string = 'walkThrough'; + export const walkThrough = 'walkThrough'; /** * An embedded code snippet. */ - export const walkThroughSnippet: string = 'walkThroughSnippet'; + export const walkThroughSnippet = 'walkThroughSnippet'; - export const http: string = 'http'; + export const http = 'http'; - export const https: string = 'https'; + export const https = 'https'; - export const file: string = 'file'; + export const file = 'file'; - export const mailto: string = 'mailto'; + export const mailto = 'mailto'; - export const untitled: string = 'untitled'; + export const untitled = 'untitled'; - export const data: string = 'data'; + export const data = 'data'; - export const command: string = 'command'; + export const command = 'command'; - export const vscodeRemote: string = 'vscode-remote'; + export const vscodeRemote = 'vscode-remote'; - export const vscodeRemoteResource: string = 'vscode-remote-resource'; + export const vscodeRemoteResource = 'vscode-remote-resource'; - export const userData: string = 'vscode-userdata'; + export const userData = 'vscode-userdata'; } class RemoteAuthoritiesImpl { diff --git a/src/vs/base/common/uint.ts b/src/vs/base/common/uint.ts index b44e0fdaec7..347af57eec2 100644 --- a/src/vs/base/common/uint.ts +++ b/src/vs/base/common/uint.ts @@ -57,12 +57,3 @@ export function toUint32(v: number): number { } return v | 0; } - -export function toUint32Array(arr: number[]): Uint32Array { - const len = arr.length; - const r = new Uint32Array(len); - for (let i = 0; i < len; i++) { - r[i] = toUint32(arr[i]); - } - return r; -} diff --git a/src/vs/base/node/ports.ts b/src/vs/base/node/ports.ts index d0334628e47..ba8297dc46f 100644 --- a/src/vs/base/node/ports.ts +++ b/src/vs/base/node/ports.ts @@ -72,6 +72,49 @@ function doFindFreePort(startPort: number, giveUpAfter: number, clb: (port: numb client.connect(startPort, '127.0.0.1'); } +/** + * Uses listen instead of connect. Is faster, but if there is another listener on 0.0.0.0 then this will take 127.0.0.1 from that listener. + */ +export function findFreePortFaster(startPort: number, giveUpAfter: number, timeout: number): Promise { + let resolved: boolean = false; + let timeoutHandle: NodeJS.Timeout | undefined = undefined; + let countTried: number = 1; + const server = net.createServer({ pauseOnConnect: true }); + function doResolve(port: number, resolve: (port: number) => void) { + if (!resolved) { + resolved = true; + server.removeAllListeners(); + server.close(); + if (timeoutHandle) { + clearTimeout(timeoutHandle); + } + resolve(port); + } + } + return new Promise(resolve => { + timeoutHandle = setTimeout(() => { + doResolve(0, resolve); + }, timeout); + + server.on('listening', () => { + doResolve(startPort, resolve); + }); + server.on('error', err => { + if (err && ((err).code === 'EADDRINUSE' || (err).code === 'EACCES') && (countTried < giveUpAfter)) { + startPort++; + countTried++; + server.listen(startPort, '127.0.0.1'); + } else { + doResolve(0, resolve); + } + }); + server.on('close', () => { + doResolve(0, resolve); + }); + server.listen(startPort, '127.0.0.1'); + }); +} + function dispose(socket: net.Socket): void { try { socket.removeAllListeners('connect'); diff --git a/src/vs/base/parts/quickopen/browser/quickopen.css b/src/vs/base/parts/quickopen/browser/quickopen.css index b6a9b9247d0..c53b0fafe24 100644 --- a/src/vs/base/parts/quickopen/browser/quickopen.css +++ b/src/vs/base/parts/quickopen/browser/quickopen.css @@ -77,7 +77,7 @@ } .monaco-quick-open-widget .quick-open-tree .monaco-icon-label, -.monaco-quick-open-widget .quick-open-tree .monaco-icon-label .monaco-icon-label-description-container { +.monaco-quick-open-widget .quick-open-tree .monaco-icon-label .monaco-icon-label-container > .monaco-icon-name-container { flex: 1; /* make sure the icon label grows within the row */ } diff --git a/src/vs/base/parts/storage/test/node/storage.test.ts b/src/vs/base/parts/storage/test/node/storage.test.ts index 4995d64b0e5..9c966c0868b 100644 --- a/src/vs/base/parts/storage/test/node/storage.test.ts +++ b/src/vs/base/parts/storage/test/node/storage.test.ts @@ -550,7 +550,7 @@ suite('SQLite Storage Library', () => { let storage = new SQLiteStorageDatabase(join(storageDir, 'storage.db')); const items1 = new Map(); - items1.set('colorthemedata', '{"id":"vs vscode-theme-defaults-themes-light_plus-json","label":"Light+ (default light)","settingsId":"Default Light+","selector":"vs.vscode-theme-defaults-themes-light_plus-json","themeTokenColors":[{"settings":{"foreground":"#000000ff","background":"#ffffffff"}},{"scope":["meta.embedded","source.groovy.embedded"],"settings":{"foreground":"#000000ff"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":"strong","settings":{"fontStyle":"bold"}},{"scope":"meta.diff.header","settings":{"foreground":"#000080"}},{"scope":"comment","settings":{"foreground":"#008000"}},{"scope":"constant.language","settings":{"foreground":"#0000ff"}},{"scope":["constant.numeric"],"settings":{"foreground":"#09885a"}},{"scope":"constant.regexp","settings":{"foreground":"#811f3f"}},{"name":"css tags in selectors, xml tags","scope":"entity.name.tag","settings":{"foreground":"#800000"}},{"scope":"entity.name.selector","settings":{"foreground":"#800000"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#ff0000"}},{"scope":["entity.other.attribute-name.class.css","entity.other.attribute-name.class.mixin.css","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.pseudo-class.css","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.attribute.scss","entity.other.attribute-name.scss"],"settings":{"foreground":"#800000"}},{"scope":"invalid","settings":{"foreground":"#cd3131"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#000080"}},{"scope":"markup.heading","settings":{"fontStyle":"bold","foreground":"#800000"}},{"scope":"markup.italic","settings":{"fontStyle":"italic"}},{"scope":"markup.inserted","settings":{"foreground":"#09885a"}},{"scope":"markup.deleted","settings":{"foreground":"#a31515"}},{"scope":"markup.changed","settings":{"foreground":"#0451a5"}},{"scope":["punctuation.definition.quote.begin.markdown","punctuation.definition.list.begin.markdown"],"settings":{"foreground":"#0451a5"}},{"scope":"markup.inline.raw","settings":{"foreground":"#800000"}},{"name":"brackets of XML/HTML tags","scope":"punctuation.definition.tag","settings":{"foreground":"#800000"}},{"scope":"meta.preprocessor","settings":{"foreground":"#0000ff"}},{"scope":"meta.preprocessor.string","settings":{"foreground":"#a31515"}},{"scope":"meta.preprocessor.numeric","settings":{"foreground":"#09885a"}},{"scope":"meta.structure.dictionary.key.python","settings":{"foreground":"#0451a5"}},{"scope":"storage","settings":{"foreground":"#0000ff"}},{"scope":"storage.type","settings":{"foreground":"#0000ff"}},{"scope":"storage.modifier","settings":{"foreground":"#0000ff"}},{"scope":"string","settings":{"foreground":"#a31515"}},{"scope":["string.comment.buffered.block.pug","string.quoted.pug","string.interpolated.pug","string.unquoted.plain.in.yaml","string.unquoted.plain.out.yaml","string.unquoted.block.yaml","string.quoted.single.yaml","string.quoted.double.xml","string.quoted.single.xml","string.unquoted.cdata.xml","string.quoted.double.html","string.quoted.single.html","string.unquoted.html","string.quoted.single.handlebars","string.quoted.double.handlebars"],"settings":{"foreground":"#0000ff"}},{"scope":"string.regexp","settings":{"foreground":"#811f3f"}},{"name":"String interpolation","scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#0000ff"}},{"name":"Reset JavaScript string interpolation expression","scope":["meta.template.expression"],"settings":{"foreground":"#000000"}},{"scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"scope":["support.type.vendored.property-name","support.type.property-name","variable.css","variable.scss","variable.other.less","source.coffee.embedded"],"settings":{"foreground":"#ff0000"}},{"scope":["support.type.property-name.json"],"settings":{"foreground":"#0451a5"}},{"scope":"keyword","settings":{"foreground":"#0000ff"}},{"scope":"keyword.control","settings":{"foreground":"#0000ff"}},{"scope":"keyword.operator","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.instanceof","keyword.operator.logical.python"],"settings":{"foreground":"#0000ff"}},{"scope":"keyword.other.unit","settings":{"foreground":"#09885a"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#800000"}},{"scope":"support.function.git-rebase","settings":{"foreground":"#0451a5"}},{"scope":"constant.sha.git-rebase","settings":{"foreground":"#09885a"}},{"name":"coloring of the Java import and package identifiers","scope":["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],"settings":{"foreground":"#000000"}},{"name":"this.self","scope":"variable.language","settings":{"foreground":"#0000ff"}},{"name":"Function declarations","scope":["entity.name.function","support.function","support.constant.handlebars"],"settings":{"foreground":"#795E26"}},{"name":"Types declaration and references","scope":["meta.return-type","support.class","support.type","entity.name.type","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],"settings":{"foreground":"#267f99"}},{"name":"Types declaration and references, TS grammar specific","scope":["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class"],"settings":{"foreground":"#267f99"}},{"name":"Control flow keywords","scope":"keyword.control","settings":{"foreground":"#AF00DB"}},{"name":"Variable and parameter name","scope":["variable","meta.definition.variable.name","support.variable","entity.name.variable"],"settings":{"foreground":"#001080"}},{"name":"Object keys, TS grammar specific","scope":["meta.object-literal.key"],"settings":{"foreground":"#001080"}},{"name":"CSS property value","scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"name":"Regular expression groups","scope":["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],"settings":{"foreground":"#d16969"}},{"scope":["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],"settings":{"foreground":"#811f3f"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.or.regexp","keyword.control.anchor.regexp"],"settings":{"foreground":"#ff0000"}},{"scope":"constant.character","settings":{"foreground":"#0000ff"}},{"scope":"constant.character.escape","settings":{"foreground":"#ff0000"}},{"scope":"token.info-token","settings":{"foreground":"#316bcd"}},{"scope":"token.warn-token","settings":{"foreground":"#cd9731"}},{"scope":"token.error-token","settings":{"foreground":"#cd3131"}},{"scope":"token.debug-token","settings":{"foreground":"#800080"}}],"extensionData":{"extensionId":"vscode.theme-defaults","extensionPublisher":"vscode","extensionName":"theme-defaults","extensionIsBuiltin":true},"colorMap":{"editor.background":"#ffffff","editor.foreground":"#000000","editor.inactiveSelectionBackground":"#e5ebf1","editorIndentGuide.background":"#d3d3d3","editorIndentGuide.activeBackground":"#939393","editor.selectionHighlightBackground":"#add6ff4d","editorSuggestWidget.background":"#f3f3f3","activityBarBadge.background":"#007acc","sideBarTitle.foreground":"#6f6f6f","list.hoverBackground":"#e8e8e8","input.placeholderForeground":"#767676","settings.textInputBorder":"#cecece","settings.numberInputBorder":"#cecece"}}'); + items1.set('colorthemedata', '{"id":"vs vscode-theme-defaults-themes-light_plus-json","label":"Light+ (default light)","settingsId":"Default Light+","selector":"vs.vscode-theme-defaults-themes-light_plus-json","themeTokenColors":[{"settings":{"foreground":"#000000ff","background":"#ffffffff"}},{"scope":["meta.embedded","source.groovy.embedded"],"settings":{"foreground":"#000000ff"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":"strong","settings":{"fontStyle":"bold"}},{"scope":"meta.diff.header","settings":{"foreground":"#000080"}},{"scope":"comment","settings":{"foreground":"#008000"}},{"scope":"constant.language","settings":{"foreground":"#0000ff"}},{"scope":["constant.numeric"],"settings":{"foreground":"#098658"}},{"scope":"constant.regexp","settings":{"foreground":"#811f3f"}},{"name":"css tags in selectors, xml tags","scope":"entity.name.tag","settings":{"foreground":"#800000"}},{"scope":"entity.name.selector","settings":{"foreground":"#800000"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#ff0000"}},{"scope":["entity.other.attribute-name.class.css","entity.other.attribute-name.class.mixin.css","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.pseudo-class.css","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.attribute.scss","entity.other.attribute-name.scss"],"settings":{"foreground":"#800000"}},{"scope":"invalid","settings":{"foreground":"#cd3131"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#000080"}},{"scope":"markup.heading","settings":{"fontStyle":"bold","foreground":"#800000"}},{"scope":"markup.italic","settings":{"fontStyle":"italic"}},{"scope":"markup.inserted","settings":{"foreground":"#098658"}},{"scope":"markup.deleted","settings":{"foreground":"#a31515"}},{"scope":"markup.changed","settings":{"foreground":"#0451a5"}},{"scope":["punctuation.definition.quote.begin.markdown","punctuation.definition.list.begin.markdown"],"settings":{"foreground":"#0451a5"}},{"scope":"markup.inline.raw","settings":{"foreground":"#800000"}},{"name":"brackets of XML/HTML tags","scope":"punctuation.definition.tag","settings":{"foreground":"#800000"}},{"scope":"meta.preprocessor","settings":{"foreground":"#0000ff"}},{"scope":"meta.preprocessor.string","settings":{"foreground":"#a31515"}},{"scope":"meta.preprocessor.numeric","settings":{"foreground":"#098658"}},{"scope":"meta.structure.dictionary.key.python","settings":{"foreground":"#0451a5"}},{"scope":"storage","settings":{"foreground":"#0000ff"}},{"scope":"storage.type","settings":{"foreground":"#0000ff"}},{"scope":"storage.modifier","settings":{"foreground":"#0000ff"}},{"scope":"string","settings":{"foreground":"#a31515"}},{"scope":["string.comment.buffered.block.pug","string.quoted.pug","string.interpolated.pug","string.unquoted.plain.in.yaml","string.unquoted.plain.out.yaml","string.unquoted.block.yaml","string.quoted.single.yaml","string.quoted.double.xml","string.quoted.single.xml","string.unquoted.cdata.xml","string.quoted.double.html","string.quoted.single.html","string.unquoted.html","string.quoted.single.handlebars","string.quoted.double.handlebars"],"settings":{"foreground":"#0000ff"}},{"scope":"string.regexp","settings":{"foreground":"#811f3f"}},{"name":"String interpolation","scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#0000ff"}},{"name":"Reset JavaScript string interpolation expression","scope":["meta.template.expression"],"settings":{"foreground":"#000000"}},{"scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"scope":["support.type.vendored.property-name","support.type.property-name","variable.css","variable.scss","variable.other.less","source.coffee.embedded"],"settings":{"foreground":"#ff0000"}},{"scope":["support.type.property-name.json"],"settings":{"foreground":"#0451a5"}},{"scope":"keyword","settings":{"foreground":"#0000ff"}},{"scope":"keyword.control","settings":{"foreground":"#0000ff"}},{"scope":"keyword.operator","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.instanceof","keyword.operator.logical.python"],"settings":{"foreground":"#0000ff"}},{"scope":"keyword.other.unit","settings":{"foreground":"#098658"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#800000"}},{"scope":"support.function.git-rebase","settings":{"foreground":"#0451a5"}},{"scope":"constant.sha.git-rebase","settings":{"foreground":"#098658"}},{"name":"coloring of the Java import and package identifiers","scope":["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],"settings":{"foreground":"#000000"}},{"name":"this.self","scope":"variable.language","settings":{"foreground":"#0000ff"}},{"name":"Function declarations","scope":["entity.name.function","support.function","support.constant.handlebars"],"settings":{"foreground":"#795E26"}},{"name":"Types declaration and references","scope":["meta.return-type","support.class","support.type","entity.name.type","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],"settings":{"foreground":"#267f99"}},{"name":"Types declaration and references, TS grammar specific","scope":["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class"],"settings":{"foreground":"#267f99"}},{"name":"Control flow keywords","scope":"keyword.control","settings":{"foreground":"#AF00DB"}},{"name":"Variable and parameter name","scope":["variable","meta.definition.variable.name","support.variable","entity.name.variable"],"settings":{"foreground":"#001080"}},{"name":"Object keys, TS grammar specific","scope":["meta.object-literal.key"],"settings":{"foreground":"#001080"}},{"name":"CSS property value","scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"name":"Regular expression groups","scope":["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],"settings":{"foreground":"#d16969"}},{"scope":["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],"settings":{"foreground":"#811f3f"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.or.regexp","keyword.control.anchor.regexp"],"settings":{"foreground":"#ff0000"}},{"scope":"constant.character","settings":{"foreground":"#0000ff"}},{"scope":"constant.character.escape","settings":{"foreground":"#ff0000"}},{"scope":"token.info-token","settings":{"foreground":"#316bcd"}},{"scope":"token.warn-token","settings":{"foreground":"#cd9731"}},{"scope":"token.error-token","settings":{"foreground":"#cd3131"}},{"scope":"token.debug-token","settings":{"foreground":"#800080"}}],"extensionData":{"extensionId":"vscode.theme-defaults","extensionPublisher":"vscode","extensionName":"theme-defaults","extensionIsBuiltin":true},"colorMap":{"editor.background":"#ffffff","editor.foreground":"#000000","editor.inactiveSelectionBackground":"#e5ebf1","editorIndentGuide.background":"#d3d3d3","editorIndentGuide.activeBackground":"#939393","editor.selectionHighlightBackground":"#add6ff4d","editorSuggestWidget.background":"#f3f3f3","activityBarBadge.background":"#007acc","sideBarTitle.foreground":"#6f6f6f","list.hoverBackground":"#e8e8e8","input.placeholderForeground":"#767676","settings.textInputBorder":"#cecece","settings.numberInputBorder":"#cecece"}}'); items1.set('commandpalette.mru.cache', '{"usesLRU":true,"entries":[{"key":"revealFileInOS","value":3},{"key":"extension.openInGitHub","value":4},{"key":"workbench.extensions.action.openExtensionsFolder","value":11},{"key":"workbench.action.showRuntimeExtensions","value":14},{"key":"workbench.action.toggleTabsVisibility","value":15},{"key":"extension.liveServerPreview.open","value":16},{"key":"workbench.action.openIssueReporter","value":18},{"key":"workbench.action.openProcessExplorer","value":19},{"key":"workbench.action.toggleSharedProcess","value":20},{"key":"workbench.action.configureLocale","value":21},{"key":"workbench.action.appPerf","value":22},{"key":"workbench.action.reportPerformanceIssueUsingReporter","value":23},{"key":"workbench.action.openGlobalKeybindings","value":25},{"key":"workbench.action.output.toggleOutput","value":27},{"key":"extension.sayHello","value":29}]}'); items1.set('cpp.1.lastsessiondate', 'Fri Oct 05 2018'); items1.set('debug.actionswidgetposition', '0.6880952380952381'); @@ -641,7 +641,7 @@ suite('SQLite Storage Library', () => { let storage = new SQLiteStorageDatabase(join(storageDir, 'storage.db')); const items = new Map(); - items.set('colorthemedata', '{"id":"vs vscode-theme-defaults-themes-light_plus-json","label":"Light+ (default light)","settingsId":"Default Light+","selector":"vs.vscode-theme-defaults-themes-light_plus-json","themeTokenColors":[{"settings":{"foreground":"#000000ff","background":"#ffffffff"}},{"scope":["meta.embedded","source.groovy.embedded"],"settings":{"foreground":"#000000ff"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":"strong","settings":{"fontStyle":"bold"}},{"scope":"meta.diff.header","settings":{"foreground":"#000080"}},{"scope":"comment","settings":{"foreground":"#008000"}},{"scope":"constant.language","settings":{"foreground":"#0000ff"}},{"scope":["constant.numeric"],"settings":{"foreground":"#09885a"}},{"scope":"constant.regexp","settings":{"foreground":"#811f3f"}},{"name":"css tags in selectors, xml tags","scope":"entity.name.tag","settings":{"foreground":"#800000"}},{"scope":"entity.name.selector","settings":{"foreground":"#800000"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#ff0000"}},{"scope":["entity.other.attribute-name.class.css","entity.other.attribute-name.class.mixin.css","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.pseudo-class.css","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.attribute.scss","entity.other.attribute-name.scss"],"settings":{"foreground":"#800000"}},{"scope":"invalid","settings":{"foreground":"#cd3131"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#000080"}},{"scope":"markup.heading","settings":{"fontStyle":"bold","foreground":"#800000"}},{"scope":"markup.italic","settings":{"fontStyle":"italic"}},{"scope":"markup.inserted","settings":{"foreground":"#09885a"}},{"scope":"markup.deleted","settings":{"foreground":"#a31515"}},{"scope":"markup.changed","settings":{"foreground":"#0451a5"}},{"scope":["punctuation.definition.quote.begin.markdown","punctuation.definition.list.begin.markdown"],"settings":{"foreground":"#0451a5"}},{"scope":"markup.inline.raw","settings":{"foreground":"#800000"}},{"name":"brackets of XML/HTML tags","scope":"punctuation.definition.tag","settings":{"foreground":"#800000"}},{"scope":"meta.preprocessor","settings":{"foreground":"#0000ff"}},{"scope":"meta.preprocessor.string","settings":{"foreground":"#a31515"}},{"scope":"meta.preprocessor.numeric","settings":{"foreground":"#09885a"}},{"scope":"meta.structure.dictionary.key.python","settings":{"foreground":"#0451a5"}},{"scope":"storage","settings":{"foreground":"#0000ff"}},{"scope":"storage.type","settings":{"foreground":"#0000ff"}},{"scope":"storage.modifier","settings":{"foreground":"#0000ff"}},{"scope":"string","settings":{"foreground":"#a31515"}},{"scope":["string.comment.buffered.block.pug","string.quoted.pug","string.interpolated.pug","string.unquoted.plain.in.yaml","string.unquoted.plain.out.yaml","string.unquoted.block.yaml","string.quoted.single.yaml","string.quoted.double.xml","string.quoted.single.xml","string.unquoted.cdata.xml","string.quoted.double.html","string.quoted.single.html","string.unquoted.html","string.quoted.single.handlebars","string.quoted.double.handlebars"],"settings":{"foreground":"#0000ff"}},{"scope":"string.regexp","settings":{"foreground":"#811f3f"}},{"name":"String interpolation","scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#0000ff"}},{"name":"Reset JavaScript string interpolation expression","scope":["meta.template.expression"],"settings":{"foreground":"#000000"}},{"scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"scope":["support.type.vendored.property-name","support.type.property-name","variable.css","variable.scss","variable.other.less","source.coffee.embedded"],"settings":{"foreground":"#ff0000"}},{"scope":["support.type.property-name.json"],"settings":{"foreground":"#0451a5"}},{"scope":"keyword","settings":{"foreground":"#0000ff"}},{"scope":"keyword.control","settings":{"foreground":"#0000ff"}},{"scope":"keyword.operator","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.instanceof","keyword.operator.logical.python"],"settings":{"foreground":"#0000ff"}},{"scope":"keyword.other.unit","settings":{"foreground":"#09885a"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#800000"}},{"scope":"support.function.git-rebase","settings":{"foreground":"#0451a5"}},{"scope":"constant.sha.git-rebase","settings":{"foreground":"#09885a"}},{"name":"coloring of the Java import and package identifiers","scope":["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],"settings":{"foreground":"#000000"}},{"name":"this.self","scope":"variable.language","settings":{"foreground":"#0000ff"}},{"name":"Function declarations","scope":["entity.name.function","support.function","support.constant.handlebars"],"settings":{"foreground":"#795E26"}},{"name":"Types declaration and references","scope":["meta.return-type","support.class","support.type","entity.name.type","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],"settings":{"foreground":"#267f99"}},{"name":"Types declaration and references, TS grammar specific","scope":["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class"],"settings":{"foreground":"#267f99"}},{"name":"Control flow keywords","scope":"keyword.control","settings":{"foreground":"#AF00DB"}},{"name":"Variable and parameter name","scope":["variable","meta.definition.variable.name","support.variable","entity.name.variable"],"settings":{"foreground":"#001080"}},{"name":"Object keys, TS grammar specific","scope":["meta.object-literal.key"],"settings":{"foreground":"#001080"}},{"name":"CSS property value","scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"name":"Regular expression groups","scope":["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],"settings":{"foreground":"#d16969"}},{"scope":["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],"settings":{"foreground":"#811f3f"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.or.regexp","keyword.control.anchor.regexp"],"settings":{"foreground":"#ff0000"}},{"scope":"constant.character","settings":{"foreground":"#0000ff"}},{"scope":"constant.character.escape","settings":{"foreground":"#ff0000"}},{"scope":"token.info-token","settings":{"foreground":"#316bcd"}},{"scope":"token.warn-token","settings":{"foreground":"#cd9731"}},{"scope":"token.error-token","settings":{"foreground":"#cd3131"}},{"scope":"token.debug-token","settings":{"foreground":"#800080"}}],"extensionData":{"extensionId":"vscode.theme-defaults","extensionPublisher":"vscode","extensionName":"theme-defaults","extensionIsBuiltin":true},"colorMap":{"editor.background":"#ffffff","editor.foreground":"#000000","editor.inactiveSelectionBackground":"#e5ebf1","editorIndentGuide.background":"#d3d3d3","editorIndentGuide.activeBackground":"#939393","editor.selectionHighlightBackground":"#add6ff4d","editorSuggestWidget.background":"#f3f3f3","activityBarBadge.background":"#007acc","sideBarTitle.foreground":"#6f6f6f","list.hoverBackground":"#e8e8e8","input.placeholderForeground":"#767676","settings.textInputBorder":"#cecece","settings.numberInputBorder":"#cecece"}}'); + items.set('colorthemedata', '{"id":"vs vscode-theme-defaults-themes-light_plus-json","label":"Light+ (default light)","settingsId":"Default Light+","selector":"vs.vscode-theme-defaults-themes-light_plus-json","themeTokenColors":[{"settings":{"foreground":"#000000ff","background":"#ffffffff"}},{"scope":["meta.embedded","source.groovy.embedded"],"settings":{"foreground":"#000000ff"}},{"scope":"emphasis","settings":{"fontStyle":"italic"}},{"scope":"strong","settings":{"fontStyle":"bold"}},{"scope":"meta.diff.header","settings":{"foreground":"#000080"}},{"scope":"comment","settings":{"foreground":"#008000"}},{"scope":"constant.language","settings":{"foreground":"#0000ff"}},{"scope":["constant.numeric"],"settings":{"foreground":"#098658"}},{"scope":"constant.regexp","settings":{"foreground":"#811f3f"}},{"name":"css tags in selectors, xml tags","scope":"entity.name.tag","settings":{"foreground":"#800000"}},{"scope":"entity.name.selector","settings":{"foreground":"#800000"}},{"scope":"entity.other.attribute-name","settings":{"foreground":"#ff0000"}},{"scope":["entity.other.attribute-name.class.css","entity.other.attribute-name.class.mixin.css","entity.other.attribute-name.id.css","entity.other.attribute-name.parent-selector.css","entity.other.attribute-name.pseudo-class.css","entity.other.attribute-name.pseudo-element.css","source.css.less entity.other.attribute-name.id","entity.other.attribute-name.attribute.scss","entity.other.attribute-name.scss"],"settings":{"foreground":"#800000"}},{"scope":"invalid","settings":{"foreground":"#cd3131"}},{"scope":"markup.underline","settings":{"fontStyle":"underline"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#000080"}},{"scope":"markup.heading","settings":{"fontStyle":"bold","foreground":"#800000"}},{"scope":"markup.italic","settings":{"fontStyle":"italic"}},{"scope":"markup.inserted","settings":{"foreground":"#098658"}},{"scope":"markup.deleted","settings":{"foreground":"#a31515"}},{"scope":"markup.changed","settings":{"foreground":"#0451a5"}},{"scope":["punctuation.definition.quote.begin.markdown","punctuation.definition.list.begin.markdown"],"settings":{"foreground":"#0451a5"}},{"scope":"markup.inline.raw","settings":{"foreground":"#800000"}},{"name":"brackets of XML/HTML tags","scope":"punctuation.definition.tag","settings":{"foreground":"#800000"}},{"scope":"meta.preprocessor","settings":{"foreground":"#0000ff"}},{"scope":"meta.preprocessor.string","settings":{"foreground":"#a31515"}},{"scope":"meta.preprocessor.numeric","settings":{"foreground":"#098658"}},{"scope":"meta.structure.dictionary.key.python","settings":{"foreground":"#0451a5"}},{"scope":"storage","settings":{"foreground":"#0000ff"}},{"scope":"storage.type","settings":{"foreground":"#0000ff"}},{"scope":"storage.modifier","settings":{"foreground":"#0000ff"}},{"scope":"string","settings":{"foreground":"#a31515"}},{"scope":["string.comment.buffered.block.pug","string.quoted.pug","string.interpolated.pug","string.unquoted.plain.in.yaml","string.unquoted.plain.out.yaml","string.unquoted.block.yaml","string.quoted.single.yaml","string.quoted.double.xml","string.quoted.single.xml","string.unquoted.cdata.xml","string.quoted.double.html","string.quoted.single.html","string.unquoted.html","string.quoted.single.handlebars","string.quoted.double.handlebars"],"settings":{"foreground":"#0000ff"}},{"scope":"string.regexp","settings":{"foreground":"#811f3f"}},{"name":"String interpolation","scope":["punctuation.definition.template-expression.begin","punctuation.definition.template-expression.end","punctuation.section.embedded"],"settings":{"foreground":"#0000ff"}},{"name":"Reset JavaScript string interpolation expression","scope":["meta.template.expression"],"settings":{"foreground":"#000000"}},{"scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"scope":["support.type.vendored.property-name","support.type.property-name","variable.css","variable.scss","variable.other.less","source.coffee.embedded"],"settings":{"foreground":"#ff0000"}},{"scope":["support.type.property-name.json"],"settings":{"foreground":"#0451a5"}},{"scope":"keyword","settings":{"foreground":"#0000ff"}},{"scope":"keyword.control","settings":{"foreground":"#0000ff"}},{"scope":"keyword.operator","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.new","keyword.operator.expression","keyword.operator.cast","keyword.operator.sizeof","keyword.operator.instanceof","keyword.operator.logical.python"],"settings":{"foreground":"#0000ff"}},{"scope":"keyword.other.unit","settings":{"foreground":"#098658"}},{"scope":["punctuation.section.embedded.begin.php","punctuation.section.embedded.end.php"],"settings":{"foreground":"#800000"}},{"scope":"support.function.git-rebase","settings":{"foreground":"#0451a5"}},{"scope":"constant.sha.git-rebase","settings":{"foreground":"#098658"}},{"name":"coloring of the Java import and package identifiers","scope":["storage.modifier.import.java","variable.language.wildcard.java","storage.modifier.package.java"],"settings":{"foreground":"#000000"}},{"name":"this.self","scope":"variable.language","settings":{"foreground":"#0000ff"}},{"name":"Function declarations","scope":["entity.name.function","support.function","support.constant.handlebars"],"settings":{"foreground":"#795E26"}},{"name":"Types declaration and references","scope":["meta.return-type","support.class","support.type","entity.name.type","entity.name.class","storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","storage.type.cs","storage.type.generic.cs","storage.type.modifier.cs","storage.type.variable.cs","storage.type.annotation.java","storage.type.generic.java","storage.type.java","storage.type.object.array.java","storage.type.primitive.array.java","storage.type.primitive.java","storage.type.token.java","storage.type.groovy","storage.type.annotation.groovy","storage.type.parameters.groovy","storage.type.generic.groovy","storage.type.object.array.groovy","storage.type.primitive.array.groovy","storage.type.primitive.groovy"],"settings":{"foreground":"#267f99"}},{"name":"Types declaration and references, TS grammar specific","scope":["meta.type.cast.expr","meta.type.new.expr","support.constant.math","support.constant.dom","support.constant.json","entity.other.inherited-class"],"settings":{"foreground":"#267f99"}},{"name":"Control flow keywords","scope":"keyword.control","settings":{"foreground":"#AF00DB"}},{"name":"Variable and parameter name","scope":["variable","meta.definition.variable.name","support.variable","entity.name.variable"],"settings":{"foreground":"#001080"}},{"name":"Object keys, TS grammar specific","scope":["meta.object-literal.key"],"settings":{"foreground":"#001080"}},{"name":"CSS property value","scope":["support.constant.property-value","support.constant.font-name","support.constant.media-type","support.constant.media","constant.other.color.rgb-value","constant.other.rgb-value","support.constant.color"],"settings":{"foreground":"#0451a5"}},{"name":"Regular expression groups","scope":["punctuation.definition.group.regexp","punctuation.definition.group.assertion.regexp","punctuation.definition.character-class.regexp","punctuation.character.set.begin.regexp","punctuation.character.set.end.regexp","keyword.operator.negation.regexp","support.other.parenthesis.regexp"],"settings":{"foreground":"#d16969"}},{"scope":["constant.character.character-class.regexp","constant.other.character-class.set.regexp","constant.other.character-class.regexp","constant.character.set.regexp"],"settings":{"foreground":"#811f3f"}},{"scope":"keyword.operator.quantifier.regexp","settings":{"foreground":"#000000"}},{"scope":["keyword.operator.or.regexp","keyword.control.anchor.regexp"],"settings":{"foreground":"#ff0000"}},{"scope":"constant.character","settings":{"foreground":"#0000ff"}},{"scope":"constant.character.escape","settings":{"foreground":"#ff0000"}},{"scope":"token.info-token","settings":{"foreground":"#316bcd"}},{"scope":"token.warn-token","settings":{"foreground":"#cd9731"}},{"scope":"token.error-token","settings":{"foreground":"#cd3131"}},{"scope":"token.debug-token","settings":{"foreground":"#800080"}}],"extensionData":{"extensionId":"vscode.theme-defaults","extensionPublisher":"vscode","extensionName":"theme-defaults","extensionIsBuiltin":true},"colorMap":{"editor.background":"#ffffff","editor.foreground":"#000000","editor.inactiveSelectionBackground":"#e5ebf1","editorIndentGuide.background":"#d3d3d3","editorIndentGuide.activeBackground":"#939393","editor.selectionHighlightBackground":"#add6ff4d","editorSuggestWidget.background":"#f3f3f3","activityBarBadge.background":"#007acc","sideBarTitle.foreground":"#6f6f6f","list.hoverBackground":"#e8e8e8","input.placeholderForeground":"#767676","settings.textInputBorder":"#cecece","settings.numberInputBorder":"#cecece"}}'); items.set('commandpalette.mru.cache', '{"usesLRU":true,"entries":[{"key":"revealFileInOS","value":3},{"key":"extension.openInGitHub","value":4},{"key":"workbench.extensions.action.openExtensionsFolder","value":11},{"key":"workbench.action.showRuntimeExtensions","value":14},{"key":"workbench.action.toggleTabsVisibility","value":15},{"key":"extension.liveServerPreview.open","value":16},{"key":"workbench.action.openIssueReporter","value":18},{"key":"workbench.action.openProcessExplorer","value":19},{"key":"workbench.action.toggleSharedProcess","value":20},{"key":"workbench.action.configureLocale","value":21},{"key":"workbench.action.appPerf","value":22},{"key":"workbench.action.reportPerformanceIssueUsingReporter","value":23},{"key":"workbench.action.openGlobalKeybindings","value":25},{"key":"workbench.action.output.toggleOutput","value":27},{"key":"extension.sayHello","value":29}]}'); let uuid = generateUuid(); diff --git a/src/vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts b/src/vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts index 9dad8183e91..5ab03d9cd4c 100644 --- a/src/vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts +++ b/src/vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts @@ -8,10 +8,7 @@ import { ScrollbarState } from 'vs/base/browser/ui/scrollbar/scrollbarState'; suite('ScrollbarState', () => { test('inflates slider size', () => { - let actual = new ScrollbarState(0, 14, 0); - actual.setVisibleSize(339); - actual.setScrollSize(42423); - actual.setScrollPosition(32787); + let actual = new ScrollbarState(0, 14, 0, 339, 42423, 32787); assert.equal(actual.getArrowSize(), 0); assert.equal(actual.getScrollPosition(), 32787); @@ -34,10 +31,7 @@ suite('ScrollbarState', () => { }); test('inflates slider size with arrows', () => { - let actual = new ScrollbarState(12, 14, 0); - actual.setVisibleSize(339); - actual.setScrollSize(42423); - actual.setScrollPosition(32787); + let actual = new ScrollbarState(12, 14, 0, 339, 42423, 32787); assert.equal(actual.getArrowSize(), 12); assert.equal(actual.getScrollPosition(), 32787); diff --git a/src/vs/base/test/common/event.test.ts b/src/vs/base/test/common/event.test.ts index 8c9d65ba20b..bb589ca7633 100644 --- a/src/vs/base/test/common/event.test.ts +++ b/src/vs/base/test/common/event.test.ts @@ -237,6 +237,20 @@ suite('Event', function () { assert.equal(calls, 2); }); + test('Debounce Event - leading reset', async function () { + const emitter = new Emitter(); + let debounced = Event.debounce(emitter.event, (l, e) => l ? l + 1 : 1, 0, /*leading=*/true); + + let calls: number[] = []; + debounced((e) => calls.push(e)); + + emitter.fire(1); + emitter.fire(1); + + await timeout(1); + assert.deepEqual(calls, [1, 1]); + }); + test('Emitter - In Order Delivery', function () { const a = new Emitter(); const listener2Events: string[] = []; diff --git a/src/vs/base/test/common/lazy.test.ts b/src/vs/base/test/common/lazy.test.ts index c6a1655513f..04d4a256985 100644 --- a/src/vs/base/test/common/lazy.test.ts +++ b/src/vs/base/test/common/lazy.test.ts @@ -47,7 +47,7 @@ suite('Lazy', () => { assert.deepEqual(innerLazy.getValue(), [1, 11]); }); - test('map should should handle error values', () => { + test('map should handle error values', () => { let outer = 0; let inner = 10; const outerLazy = new Lazy(() => { throw new Error(`${++outer}`); }); diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index ee7fab8ba62..a28a1ea8d6c 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -12,8 +12,8 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { ExtensionManagementChannel } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; -import { IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { ExtensionManagementChannel, GlobalExtensionEnablementServiceClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc'; +import { IExtensionManagementService, IExtensionGalleryService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -50,20 +50,18 @@ import { IFileService } from 'vs/platform/files/common/files'; import { DiskFileSystemProvider } from 'vs/platform/files/electron-browser/diskFileSystemProvider'; import { Schemas } from 'vs/base/common/network'; import { IProductService } from 'vs/platform/product/common/productService'; -import { IUserDataSyncService, IUserDataSyncStoreService, registerConfiguration, IUserDataSyncLogService, IUserDataSyncUtilService, ISettingsSyncService } from 'vs/platform/userDataSync/common/userDataSync'; +import { IUserDataSyncService, IUserDataSyncStoreService, registerConfiguration, IUserDataSyncLogService, IUserDataSyncUtilService, ISettingsSyncService, IUserDataAuthTokenService } from 'vs/platform/userDataSync/common/userDataSync'; import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyncService'; import { UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService'; -import { UserDataSyncChannel, UserDataSyncUtilServiceClient, SettingsSyncChannel } from 'vs/platform/userDataSync/common/userDataSyncIpc'; +import { UserDataSyncChannel, UserDataSyncUtilServiceClient, SettingsSyncChannel, UserDataAuthTokenServiceChannel, UserDataAutoSyncChannel } from 'vs/platform/userDataSync/common/userDataSyncIpc'; import { IElectronService } from 'vs/platform/electron/node/electron'; import { LoggerService } from 'vs/platform/log/node/loggerService'; import { UserDataSyncLogService } from 'vs/platform/userDataSync/common/userDataSyncLog'; -import { IAuthTokenService } from 'vs/platform/auth/common/auth'; -import { AuthTokenService } from 'vs/platform/auth/electron-browser/authTokenService'; -import { AuthTokenChannel } from 'vs/platform/auth/common/authTokenIpc'; import { ICredentialsService } from 'vs/platform/credentials/common/credentials'; import { KeytarCredentialsService } from 'vs/platform/credentials/node/credentialsService'; import { UserDataAutoSync } from 'vs/platform/userDataSync/electron-browser/userDataAutoSync'; import { SettingsSynchroniser } from 'vs/platform/userDataSync/common/settingsSync'; +import { UserDataAuthTokenService } from 'vs/platform/userDataSync/common/userDataAuthTokenService'; export interface ISharedProcessConfiguration { readonly machineId: string; @@ -115,6 +113,9 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat disposables.add(logService); logService.info('main', JSON.stringify(configuration)); + const mainProcessService = new MainProcessService(server, mainRouter); + services.set(IMainProcessService, mainProcessService); + const configurationService = new ConfigurationService(environmentService.settingsResource); disposables.add(configurationService); await configurationService.initialize(); @@ -126,8 +127,6 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat services.set(IRequestService, new SyncDescriptor(RequestService)); services.set(ILoggerService, new SyncDescriptor(LoggerService)); - const mainProcessService = new MainProcessService(server, mainRouter); - services.set(IMainProcessService, mainProcessService); const electronService = createChannelSender(mainProcessService.getChannel('electron'), { context: configuration.windowId }); services.set(IElectronService, electronService); @@ -183,9 +182,10 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat services.set(IDiagnosticsService, new SyncDescriptor(DiagnosticsService)); services.set(ICredentialsService, new SyncDescriptor(KeytarCredentialsService)); - services.set(IAuthTokenService, new SyncDescriptor(AuthTokenService)); + services.set(IUserDataAuthTokenService, new SyncDescriptor(UserDataAuthTokenService)); services.set(IUserDataSyncLogService, new SyncDescriptor(UserDataSyncLogService)); services.set(IUserDataSyncUtilService, new UserDataSyncUtilServiceClient(server.getChannel('userDataSyncUtil', activeWindowRouter))); + services.set(IGlobalExtensionEnablementService, new GlobalExtensionEnablementServiceClient(server.getChannel('globalExtensionEnablement', activeWindowRouter))); services.set(IUserDataSyncStoreService, new SyncDescriptor(UserDataSyncStoreService)); services.set(ISettingsSyncService, new SyncDescriptor(SettingsSynchroniser)); services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService)); @@ -207,8 +207,8 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat const diagnosticsChannel = new DiagnosticsChannel(diagnosticsService); server.registerChannel('diagnostics', diagnosticsChannel); - const authTokenService = accessor.get(IAuthTokenService); - const authTokenChannel = new AuthTokenChannel(authTokenService); + const authTokenService = accessor.get(IUserDataAuthTokenService); + const authTokenChannel = new UserDataAuthTokenServiceChannel(authTokenService); server.registerChannel('authToken', authTokenChannel); const settingsSyncService = accessor.get(ISettingsSyncService); @@ -219,6 +219,10 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat const userDataSyncChannel = new UserDataSyncChannel(userDataSyncService); server.registerChannel('userDataSync', userDataSyncChannel); + const userDataAutoSync = instantiationService2.createInstance(UserDataAutoSync); + const userDataAutoSyncChannel = new UserDataAutoSyncChannel(userDataAutoSync); + server.registerChannel('userDataAutoSync', userDataAutoSyncChannel); + // clean up deprecated extensions (extensionManagementService as ExtensionManagementService).removeDeprecatedExtensions(); // update localizations cache @@ -229,7 +233,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat instantiationService2.createInstance(LanguagePackCachedDataCleaner), instantiationService2.createInstance(StorageDataCleaner), instantiationService2.createInstance(LogsDataCleaner), - instantiationService2.createInstance(UserDataAutoSync) + userDataAutoSync )); disposables.add(extensionManagementService as ExtensionManagementService); }); diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts index 471c97e1162..8ba8c494b7a 100644 --- a/src/vs/editor/browser/config/configuration.ts +++ b/src/vs/editor/browser/config/configuration.ts @@ -14,7 +14,7 @@ import { CommonEditorConfiguration, IEnvConfiguration } from 'vs/editor/common/c import { EditorOption, IEditorConstructionOptions, EditorFontLigatures } from 'vs/editor/common/config/editorOptions'; import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo'; import { IDimension } from 'vs/editor/common/editorCommon'; -import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; +import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; class CSSBasedConfigurationCache { @@ -87,6 +87,7 @@ export interface ISerializedFontInfo { readonly typicalFullwidthCharacterWidth: number; readonly canUseHalfwidthRightwardsArrow: boolean; readonly spaceWidth: number; + middotWidth: number; readonly maxDigitWidth: number; } @@ -159,6 +160,7 @@ class CSSBasedConfiguration extends Disposable { const savedFontInfo = savedFontInfos[i]; // compatibility with older versions of VS Code which did not store this... savedFontInfo.fontFeatureSettings = savedFontInfo.fontFeatureSettings || EditorFontLigatures.OFF; + savedFontInfo.middotWidth = savedFontInfo.middotWidth || savedFontInfo.spaceWidth; const fontInfo = new FontInfo(savedFontInfo, false); this._writeToCache(fontInfo, fontInfo); } @@ -183,6 +185,7 @@ class CSSBasedConfiguration extends Disposable { typicalFullwidthCharacterWidth: Math.max(readConfig.typicalFullwidthCharacterWidth, 5), canUseHalfwidthRightwardsArrow: readConfig.canUseHalfwidthRightwardsArrow, spaceWidth: Math.max(readConfig.spaceWidth, 5), + middotWidth: Math.max(readConfig.middotWidth, 5), maxDigitWidth: Math.max(readConfig.maxDigitWidth, 5), }, false); } @@ -223,7 +226,8 @@ class CSSBasedConfiguration extends Disposable { const rightwardsArrow = this.createRequest('→', CharWidthRequestType.Regular, all, monospace); const halfwidthRightwardsArrow = this.createRequest('→', CharWidthRequestType.Regular, all, null); - this.createRequest('·', CharWidthRequestType.Regular, all, monospace); + // middle dot character + const middot = this.createRequest('·', CharWidthRequestType.Regular, all, monospace); // monospace test: some characters this.createRequest('|', CharWidthRequestType.Regular, all, monospace); @@ -289,6 +293,7 @@ class CSSBasedConfiguration extends Disposable { typicalFullwidthCharacterWidth: typicalFullwidthCharacter.width, canUseHalfwidthRightwardsArrow: canUseHalfwidthRightwardsArrow, spaceWidth: space.width, + middotWidth: middot.width, maxDigitWidth: maxDigitWidth }, canTrustBrowserZoomLevel); } @@ -333,7 +338,7 @@ export class Configuration extends CommonEditorConfiguration { } this._register(browser.onDidChangeZoomLevel(_ => this._recomputeOptions())); - this._register(this.accessibilityService.onDidChangeAccessibilitySupport(() => this._recomputeOptions())); + this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions())); this._recomputeOptions(); } @@ -374,7 +379,7 @@ export class Configuration extends CommonEditorConfiguration { emptySelectionClipboard: browser.isWebKit || browser.isFirefox, pixelRatio: browser.getPixelRatio(), zoomLevel: browser.getZoomLevel(), - accessibilitySupport: this.accessibilityService.getAccessibilitySupport() + accessibilitySupport: this.accessibilityService.isScreenReaderOptimized() ? AccessibilitySupport.Enabled : AccessibilitySupport.Disabled }; } diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts index 973a5ca1d3d..0e5f6b0d454 100644 --- a/src/vs/editor/browser/controller/mouseHandler.ts +++ b/src/vs/editor/browser/controller/mouseHandler.ts @@ -10,7 +10,7 @@ import { RunOnceScheduler, TimeoutTimer } from 'vs/base/common/async'; import { Disposable } from 'vs/base/common/lifecycle'; import * as platform from 'vs/base/common/platform'; import { HitTestContext, IViewZoneData, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from 'vs/editor/browser/controller/mouseTarget'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; +import { IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorMouseMoveMonitor, createEditorPagePosition } from 'vs/editor/browser/editorDom'; import { ViewController } from 'vs/editor/browser/view/viewController'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; @@ -148,7 +148,7 @@ export class MouseHandler extends ViewEventHandler { } // --- end event handlers - public getTargetAtClientPoint(clientX: number, clientY: number): editorBrowser.IMouseTarget | null { + public getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null { const clientPos = new ClientCoordinates(clientX, clientY); const pos = clientPos.toPageCoordinates(); const editorPos = createEditorPagePosition(this.viewHelper.viewDomNode); @@ -160,7 +160,7 @@ export class MouseHandler extends ViewEventHandler { return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, null); } - protected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): editorBrowser.IMouseTarget { + protected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget { return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, testEventTarget ? e.target : null); } @@ -210,12 +210,12 @@ export class MouseHandler extends ViewEventHandler { public _onMouseDown(e: EditorMouseEvent): void { const t = this._createMouseTarget(e, true); - const targetIsContent = (t.type === editorBrowser.MouseTargetType.CONTENT_TEXT || t.type === editorBrowser.MouseTargetType.CONTENT_EMPTY); - const targetIsGutter = (t.type === editorBrowser.MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === editorBrowser.MouseTargetType.GUTTER_LINE_NUMBERS || t.type === editorBrowser.MouseTargetType.GUTTER_LINE_DECORATIONS); - const targetIsLineNumbers = (t.type === editorBrowser.MouseTargetType.GUTTER_LINE_NUMBERS); + const targetIsContent = (t.type === MouseTargetType.CONTENT_TEXT || t.type === MouseTargetType.CONTENT_EMPTY); + const targetIsGutter = (t.type === MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === MouseTargetType.GUTTER_LINE_NUMBERS || t.type === MouseTargetType.GUTTER_LINE_DECORATIONS); + const targetIsLineNumbers = (t.type === MouseTargetType.GUTTER_LINE_NUMBERS); const selectOnLineNumbers = this._context.configuration.options.get(EditorOption.selectOnLineNumbers); - const targetIsViewZone = (t.type === editorBrowser.MouseTargetType.CONTENT_VIEW_ZONE || t.type === editorBrowser.MouseTargetType.GUTTER_VIEW_ZONE); - const targetIsWidget = (t.type === editorBrowser.MouseTargetType.CONTENT_WIDGET); + const targetIsViewZone = (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE); + const targetIsWidget = (t.type === MouseTargetType.CONTENT_WIDGET); let shouldHandle = e.leftButton || e.middleButton; if (platform.isMacintosh && e.leftButton && e.ctrlKey) { @@ -269,7 +269,7 @@ class MouseDownOperation extends Disposable { private readonly _context: ViewContext; private readonly _viewController: ViewController; private readonly _viewHelper: IPointerHandlerHelper; - private readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => editorBrowser.IMouseTarget; + private readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget; private readonly _getMouseColumn: (e: EditorMouseEvent) => number; private readonly _mouseMoveMonitor: GlobalEditorMouseMoveMonitor; @@ -284,7 +284,7 @@ class MouseDownOperation extends Disposable { context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper, - createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => editorBrowser.IMouseTarget, + createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget, getMouseColumn: (e: EditorMouseEvent) => number ) { super(); @@ -331,10 +331,10 @@ class MouseDownOperation extends Disposable { } } - public start(targetType: editorBrowser.MouseTargetType, e: EditorMouseEvent): void { + public start(targetType: MouseTargetType, e: EditorMouseEvent): void { this._lastMouseEvent = e; - this._mouseState.setStartedOnLineNumbers(targetType === editorBrowser.MouseTargetType.GUTTER_LINE_NUMBERS); + this._mouseState.setStartedOnLineNumbers(targetType === MouseTargetType.GUTTER_LINE_NUMBERS); this._mouseState.setStartButtons(e); this._mouseState.setModifiers(e); const position = this._findMousePosition(e, true); @@ -356,13 +356,15 @@ class MouseDownOperation extends Disposable { && e.detail < 2 // only single click on a selection can work && !this._isActive // the mouse is not down yet && !this._currentSelection.isEmpty() // we don't drag single cursor - && (position.type === editorBrowser.MouseTargetType.CONTENT_TEXT) // single click on text + && (position.type === MouseTargetType.CONTENT_TEXT) // single click on text && position.position && this._currentSelection.containsPosition(position.position) // single click on a selection ) { this._mouseState.isDragAndDrop = true; this._isActive = true; this._mouseMoveMonitor.startMonitoring( + e.target, + e.buttons, createMouseMoveEventMerger(null), (e) => this._onMouseDownThenMove(e), () => { @@ -386,6 +388,8 @@ class MouseDownOperation extends Disposable { if (!this._isActive) { this._isActive = true; this._mouseMoveMonitor.startMonitoring( + e.target, + e.buttons, createMouseMoveEventMerger(null), (e) => this._onMouseDownThenMove(e), () => this._stop() @@ -436,12 +440,12 @@ class MouseDownOperation extends Disposable { if (viewZoneData) { const newPosition = this._helpPositionJumpOverViewZone(viewZoneData); if (newPosition) { - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, newPosition); + return new MouseTarget(null, MouseTargetType.OUTSIDE_EDITOR, mouseColumn, newPosition); } } const aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset); - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(aboveLineNumber, 1)); + return new MouseTarget(null, MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(aboveLineNumber, 1)); } if (e.posy > editorContent.y + editorContent.height) { @@ -450,22 +454,22 @@ class MouseDownOperation extends Disposable { if (viewZoneData) { const newPosition = this._helpPositionJumpOverViewZone(viewZoneData); if (newPosition) { - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, newPosition); + return new MouseTarget(null, MouseTargetType.OUTSIDE_EDITOR, mouseColumn, newPosition); } } const belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset); - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber))); + return new MouseTarget(null, MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber))); } const possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + (e.posy - editorContent.y)); if (e.posx < editorContent.x) { - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, 1)); + return new MouseTarget(null, MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, 1)); } if (e.posx > editorContent.x + editorContent.width) { - return new MouseTarget(null, editorBrowser.MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber))); + return new MouseTarget(null, MouseTargetType.OUTSIDE_EDITOR, mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber))); } return null; @@ -483,7 +487,7 @@ class MouseDownOperation extends Disposable { return null; } - if (t.type === editorBrowser.MouseTargetType.CONTENT_VIEW_ZONE || t.type === editorBrowser.MouseTargetType.GUTTER_VIEW_ZONE) { + if (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE) { const newPosition = this._helpPositionJumpOverViewZone(t.detail); if (newPosition) { return new MouseTarget(t.element, t.type, t.mouseColumn, newPosition, null, t.detail); diff --git a/src/vs/editor/browser/controller/mouseTarget.ts b/src/vs/editor/browser/controller/mouseTarget.ts index c38191a19c6..f83ff9bfd94 100644 --- a/src/vs/editor/browser/controller/mouseTarget.ts +++ b/src/vs/editor/browser/controller/mouseTarget.ts @@ -17,6 +17,7 @@ import { HorizontalPosition } from 'vs/editor/common/view/renderingContext'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; import { CursorColumns } from 'vs/editor/common/controller/cursorCommon'; +import * as dom from 'vs/base/browser/dom'; export interface IViewZoneData { viewZoneId: string; @@ -835,8 +836,17 @@ export class MouseTargetFactory { } private static _actualDoHitTestWithCaretRangeFromPoint(ctx: HitTestContext, coords: ClientCoordinates): IHitTestResult { - - const range: Range = document.caretRangeFromPoint(coords.clientX, coords.clientY); + const shadowRoot = dom.getShadowRoot(ctx.viewDomNode); + let range: Range; + if (shadowRoot) { + if (typeof shadowRoot.caretRangeFromPoint === 'undefined') { + range = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY); + } else { + range = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY); + } + } else { + range = document.caretRangeFromPoint(coords.clientX, coords.clientY); + } if (!range || !range.startContainer) { return { @@ -1009,3 +1019,94 @@ export class MouseTargetFactory { }; } } + +export function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y: number): Range { + const range = document.createRange(); + + // Get the element under the point + let el: Element | null = shadowRoot.elementFromPoint(x, y); + + if (el !== null) { + // Get the last child of the element until its firstChild is a text node + // This assumes that the pointer is on the right of the line, out of the tokens + // and that we want to get the offset of the last token of the line + while (el && el.firstChild && el.firstChild.nodeType !== el.firstChild.TEXT_NODE) { + el = el.lastChild; + } + + // Grab its rect + const rect = el.getBoundingClientRect(); + + // And its font + const font = window.getComputedStyle(el, null).getPropertyValue('font'); + + // And also its txt content + const text = (el as any).innerText; + + // Position the pixel cursor at the left of the element + let pixelCursor = rect.left; + let offset = 0; + let step: number; + + // If the point is on the right of the box put the cursor after the last character + if (x > rect.left + rect.width) { + offset = text.length; + } else { + const charWidthReader = CharWidthReader.getInstance(); + // Goes through all the characters of the innerText, and checks if the x of the point + // belongs to the character. + for (let i = 0; i < text.length + 1; i++) { + // The step is half the width of the character + step = charWidthReader.getCharWidth(text.charAt(i), font) / 2; + // Move to the center of the character + pixelCursor += step; + // If the x of the point is smaller that the position of the cursor, the point is over that character + if (x < pixelCursor) { + offset = i; + break; + } + // Move between the current character and the next + pixelCursor += step; + } + } + + // Creates a range with the text node of the element and set the offset found + range.setStart(el.firstChild!, offset); + range.setEnd(el.firstChild!, offset); + } + + return range; +} + +class CharWidthReader { + private static _INSTANCE: CharWidthReader | null = null; + + public static getInstance(): CharWidthReader { + if (!CharWidthReader._INSTANCE) { + CharWidthReader._INSTANCE = new CharWidthReader(); + } + return CharWidthReader._INSTANCE; + } + + private readonly _cache: { [cacheKey: string]: number; }; + private readonly _canvas: HTMLCanvasElement; + + private constructor() { + this._cache = {}; + this._canvas = document.createElement('canvas'); + } + + public getCharWidth(char: string, font: string): number { + const cacheKey = char + font; + if (this._cache[cacheKey]) { + return this._cache[cacheKey]; + } + + const context = this._canvas.getContext('2d')!; + context.font = font; + const metrics = context.measureText(char); + const width = metrics.width; + this._cache[cacheKey] = width; + return width; + } +} diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/textAreaHandler.ts index 49ed53c81df..ea4e4f8930b 100644 --- a/src/vs/editor/browser/controller/textAreaHandler.ts +++ b/src/vs/editor/browser/controller/textAreaHandler.ts @@ -17,7 +17,7 @@ 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 } from 'vs/editor/common/config/editorOptions'; +import { RenderLineNumbersType, EditorOption, IComputedEditorOptions, EditorOptions } from 'vs/editor/common/config/editorOptions'; import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; import { WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier'; import { Position } from 'vs/editor/common/core/position'; @@ -29,6 +29,7 @@ import { RenderingContext, RestrictedRenderingContext, HorizontalPosition } from import { ViewContext } from 'vs/editor/common/view/viewContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; +import { IEditorAriaOptions } from 'vs/editor/browser/editorBrowser'; export interface ITextAreaHandlerHelper { visibleRangeForPositionRelativeToEditor(lineNumber: number, column: number): HorizontalPosition | null; @@ -61,8 +62,8 @@ export class TextAreaHandler extends ViewPart { private _scrollLeft: number; private _scrollTop: number; - private _accessibilitySupport: AccessibilitySupport; - private _accessibilityPageSize: number; + private _accessibilitySupport!: AccessibilitySupport; + private _accessibilityPageSize!: number; private _contentLeft: number; private _contentWidth: number; private _contentHeight: number; @@ -76,6 +77,7 @@ export class TextAreaHandler extends ViewPart { */ private _visibleTextArea: VisibleTextAreaData | null; private _selections: Selection[]; + private _modelSelections: Selection[]; /** * The position at which the textarea was rendered. @@ -98,11 +100,10 @@ export class TextAreaHandler extends ViewPart { const options = this._context.configuration.options; const layoutInfo = options.get(EditorOption.layoutInfo); - this._accessibilitySupport = options.get(EditorOption.accessibilitySupport); - this._accessibilityPageSize = options.get(EditorOption.accessibilityPageSize); + this._setAccessibilityOptions(options); this._contentLeft = layoutInfo.contentLeft; this._contentWidth = layoutInfo.contentWidth; - this._contentHeight = layoutInfo.contentHeight; + this._contentHeight = layoutInfo.height; this._fontInfo = options.get(EditorOption.fontInfo); this._lineHeight = options.get(EditorOption.lineHeight); this._emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard); @@ -110,6 +111,7 @@ export class TextAreaHandler extends ViewPart { this._visibleTextArea = null; this._selections = [new Selection(1, 1, 1, 1)]; + this._modelSelections = [new Selection(1, 1, 1, 1)]; this._lastRenderPosition = null; // Text Area (The focus will always be in the textarea when the cursor is blinking) @@ -148,24 +150,30 @@ export class TextAreaHandler extends ViewPart { const textAreaInputHost: ITextAreaInputHost = { getDataToCopy: (generateHTML: boolean): ClipboardDataToCopy => { - const rawTextToCopy = this._context.model.getPlainTextToCopy(this._selections, this._emptySelectionClipboard, platform.isWindows); + const rawTextToCopy = this._context.model.getPlainTextToCopy(this._modelSelections, this._emptySelectionClipboard, platform.isWindows); const newLineCharacter = this._context.model.getEOL(); - const isFromEmptySelection = (this._emptySelectionClipboard && this._selections.length === 1 && this._selections[0].isEmpty()); + 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 (generateHTML) { if (CopyOptions.forceCopyWithSyntaxHighlighting || (this._copyWithSyntaxHighlighting && text.length < 65536)) { - html = this._context.model.getHTMLToCopy(this._selections, this._emptySelectionClipboard); + const richText = this._context.model.getRichTextToCopy(this._modelSelections, this._emptySelectionClipboard); + if (richText) { + html = richText.html; + mode = richText.mode; + } } } return { isFromEmptySelection, multicursorText, text, - html + html, + mode }; }, @@ -219,11 +227,13 @@ export class TextAreaHandler extends ViewPart { this._register(this._textAreaInput.onPaste((e: IPasteData) => { let pasteOnNewLine = false; let multicursorText: string[] | null = null; + let mode: string | null = null; if (e.metadata) { pasteOnNewLine = (this._emptySelectionClipboard && !!e.metadata.isFromEmptySelection); multicursorText = (typeof e.metadata.multicursorText !== 'undefined' ? e.metadata.multicursorText : null); + mode = e.metadata.mode; } - this._viewController.paste('keyboard', e.text, pasteOnNewLine, multicursorText); + this._viewController.paste('keyboard', e.text, pasteOnNewLine, multicursorText, mode); })); this._register(this._textAreaInput.onCut(() => { @@ -343,17 +353,27 @@ export class TextAreaHandler extends ViewPart { return options.get(EditorOption.ariaLabel); } + private _setAccessibilityOptions(options: IComputedEditorOptions): void { + this._accessibilitySupport = options.get(EditorOption.accessibilitySupport); + const accessibilityPageSize = options.get(EditorOption.accessibilityPageSize); + if (this._accessibilitySupport === AccessibilitySupport.Enabled && accessibilityPageSize === EditorOptions.accessibilityPageSize.defaultValue) { + // If a screen reader is attached and the default value is not set we shuold automatically increase the page size to 1000 for a better experience + this._accessibilityPageSize = 1000; + } else { + this._accessibilityPageSize = accessibilityPageSize; + } + } + // --- begin event handlers public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { const options = this._context.configuration.options; const layoutInfo = options.get(EditorOption.layoutInfo); - this._accessibilitySupport = options.get(EditorOption.accessibilitySupport); - this._accessibilityPageSize = options.get(EditorOption.accessibilityPageSize); + this._setAccessibilityOptions(options); this._contentLeft = layoutInfo.contentLeft; this._contentWidth = layoutInfo.contentWidth; - this._contentHeight = layoutInfo.contentHeight; + this._contentHeight = layoutInfo.height; this._fontInfo = options.get(EditorOption.fontInfo); this._lineHeight = options.get(EditorOption.lineHeight); this._emptySelectionClipboard = options.get(EditorOption.emptySelectionClipboard); @@ -376,6 +396,7 @@ export class TextAreaHandler extends ViewPart { } public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { this._selections = e.selections.slice(0); + this._modelSelections = e.modelSelections.slice(0); this._textAreaInput.writeScreenReaderContent('selection changed'); return true; } @@ -424,6 +445,18 @@ export class TextAreaHandler extends ViewPart { return this._lastRenderPosition; } + public setAriaOptions(options: IEditorAriaOptions): void { + if (options.activeDescendant) { + this.textArea.setAttribute('aria-haspopup', 'true'); + this.textArea.setAttribute('aria-autocomplete', 'list'); + this.textArea.setAttribute('aria-activedescendant', options.activeDescendant); + } else { + this.textArea.setAttribute('aria-haspopup', 'false'); + this.textArea.setAttribute('aria-autocomplete', 'both'); + this.textArea.removeAttribute('aria-activedescendant'); + } + } + // --- end view API private _primaryCursorPosition: Position = new Position(1, 1); diff --git a/src/vs/editor/browser/controller/textAreaInput.ts b/src/vs/editor/browser/controller/textAreaInput.ts index 2e64c93ba59..8e80e794f8b 100644 --- a/src/vs/editor/browser/controller/textAreaInput.ts +++ b/src/vs/editor/browser/controller/textAreaInput.ts @@ -41,12 +41,14 @@ export interface ClipboardDataToCopy { 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 { @@ -550,7 +552,8 @@ export class TextAreaInput extends Disposable { const storedMetadata: ClipboardStoredMetadata = { version: 1, isFromEmptySelection: dataToCopy.isFromEmptySelection, - multicursorText: dataToCopy.multicursorText + multicursorText: dataToCopy.multicursorText, + mode: dataToCopy.mode }; InMemoryClipboardMetadataManager.INSTANCE.set( // When writing "LINE\r\n" to the clipboard and then pasting, diff --git a/src/vs/editor/browser/editorBrowser.ts b/src/vs/editor/browser/editorBrowser.ts index c359f7ee54d..85ee85e34f7 100644 --- a/src/vs/editor/browser/editorBrowser.ts +++ b/src/vs/editor/browser/editorBrowser.ts @@ -308,6 +308,14 @@ export interface IPartialEditorMouseEvent { readonly target: IMouseTarget | null; } +/** + * A paste event originating from the editor. + */ +export interface IPasteEvent { + readonly range: Range; + readonly mode: string | null; +} + /** * An overview ruler * @internal @@ -319,6 +327,14 @@ export interface IOverviewRuler { setLayout(position: OverviewRulerPosition): void; } +/** + * Editor aria options. + * @internal + */ +export interface IEditorAriaOptions { + activeDescendant: string | undefined; +} + /** * A rich code editor. */ @@ -408,11 +424,11 @@ export interface ICodeEditor extends editorCommon.IEditor { /** * An event emitted after composition has started. */ - onCompositionStart(listener: () => void): IDisposable; + onDidCompositionStart(listener: () => void): IDisposable; /** * An event emitted after composition has ended. */ - onCompositionEnd(listener: () => void): IDisposable; + onDidCompositionEnd(listener: () => void): IDisposable; /** * An event emitted when editing failed because the editor is read-only. * @event @@ -423,7 +439,7 @@ export interface ICodeEditor extends editorCommon.IEditor { * An event emitted when users paste text in the editor. * @event */ - onDidPaste(listener: (range: Range) => void): IDisposable; + onDidPaste(listener: (e: IPasteEvent) => void): IDisposable; /** * An event emitted on a "mouseup". * @event @@ -482,6 +498,11 @@ export interface ICodeEditor extends editorCommon.IEditor { * @event */ onDidLayoutChange(listener: (e: EditorLayoutInfo) => void): IDisposable; + /** + * An event emitted when the content width or content height in the editor has changed. + * @event + */ + onDidContentSizeChange(listener: (e: editorCommon.IContentSizeChangedEvent) => void): IDisposable; /** * An event emitted when the scroll in the editor has changed. * @event @@ -532,12 +553,12 @@ export interface ICodeEditor extends editorCommon.IEditor { setModel(model: ITextModel | null): void; /** - * @internal + * Gets all the editor computed options. */ getOptions(): IComputedEditorOptions; /** - * @internal + * Gets a specific editor option. */ getOption(id: T): FindComputedEditorOptionValueById; @@ -558,6 +579,11 @@ export interface ICodeEditor extends editorCommon.IEditor { */ setValue(newValue: string): void; + /** + * Get the width of the editor's content. + * This is information that is "erased" when computing `scrollWidth = Math.max(contentWidth, width)` + */ + getContentWidth(): number; /** * Get the scrollWidth of the editor's viewport. */ @@ -567,6 +593,11 @@ export interface ICodeEditor extends editorCommon.IEditor { */ getScrollLeft(): number; + /** + * Get the height of the editor's content. + * This is information that is "erased" when computing `scrollHeight = Math.max(contentHeight, height)` + */ + getContentHeight(): number; /** * Get the scrollHeight of the editor's viewport. */ @@ -689,11 +720,22 @@ export interface ICodeEditor extends editorCommon.IEditor { */ setHiddenAreas(ranges: IRange[]): void; + /** + * Sets the editor aria options, primarily the active descendent. + * @internal + */ + setAriaOptions(options: IEditorAriaOptions): void; + /** * @internal */ getTelemetryData(): { [key: string]: any } | undefined; + /** + * Returns the editor's container dom node + */ + getContainerDomNode(): HTMLElement; + /** * Returns the editor's dom node */ diff --git a/src/vs/editor/browser/editorDom.ts b/src/vs/editor/browser/editorDom.ts index 9401fdd259e..4042ae8262c 100644 --- a/src/vs/editor/browser/editorDom.ts +++ b/src/vs/editor/browser/editorDom.ts @@ -172,7 +172,7 @@ export class EditorPointerEventFactory { export class GlobalEditorMouseMoveMonitor extends Disposable { private readonly _editorViewDomNode: HTMLElement; - protected readonly _globalMouseMoveMonitor: GlobalMouseMoveMonitor; + private readonly _globalMouseMoveMonitor: GlobalMouseMoveMonitor; private _keydownListener: IDisposable | null; constructor(editorViewDomNode: HTMLElement) { @@ -182,7 +182,13 @@ export class GlobalEditorMouseMoveMonitor extends Disposable { this._keydownListener = null; } - public startMonitoring(merger: EditorMouseEventMerger, mouseMoveCallback: (e: EditorMouseEvent) => void, onStopCallback: () => void): void { + public startMonitoring( + initialElement: HTMLElement, + initialButtons: number, + merger: EditorMouseEventMerger, + mouseMoveCallback: (e: EditorMouseEvent) => void, + onStopCallback: () => void + ): void { // Add a <> keydown event listener that will cancel the monitoring // if something other than a modifier key is pressed @@ -199,7 +205,7 @@ export class GlobalEditorMouseMoveMonitor extends Disposable { return merger(lastEvent, new EditorMouseEvent(currentEvent, this._editorViewDomNode)); }; - this._globalMouseMoveMonitor.startMonitoring(myMerger, mouseMoveCallback, () => { + this._globalMouseMoveMonitor.startMonitoring(initialElement, initialButtons, myMerger, mouseMoveCallback, () => { this._keydownListener!.dispose(); onStopCallback(); }); diff --git a/src/vs/editor/browser/services/abstractCodeEditorService.ts b/src/vs/editor/browser/services/abstractCodeEditorService.ts index 53c5bac6f28..bb96485db3e 100644 --- a/src/vs/editor/browser/services/abstractCodeEditorService.ts +++ b/src/vs/editor/browser/services/abstractCodeEditorService.ts @@ -89,7 +89,7 @@ export abstract class AbstractCodeEditorService extends Disposable implements IC return editorWithWidgetFocus; } - abstract registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void; + abstract registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string, editor?: ICodeEditor): void; abstract removeDecorationType(key: string): void; abstract resolveDecorationOptions(decorationTypeKey: string | undefined, writable: boolean): IModelDecorationOptions; @@ -120,6 +120,16 @@ export abstract class AbstractCodeEditorService extends Disposable implements IC return this._transientWatchers[uri].get(key); } + public getTransientModelProperties(model: ITextModel): [string, any][] | undefined { + const uri = model.uri.toString(); + + if (!this._transientWatchers.hasOwnProperty(uri)) { + return undefined; + } + + return this._transientWatchers[uri].keys().map(key => [key, this._transientWatchers[uri].get(key)]); + } + _removeWatcher(w: ModelTransientSettingWatcher): void { delete this._transientWatchers[w.uri]; } @@ -145,4 +155,8 @@ export class ModelTransientSettingWatcher { public get(key: string): any { return this._values[key]; } + + public keys(): string[] { + return Object.keys(this._values); + } } diff --git a/src/vs/editor/browser/services/bulkEditService.ts b/src/vs/editor/browser/services/bulkEditService.ts index ada4ed7b23d..d7d1ad70417 100644 --- a/src/vs/editor/browser/services/bulkEditService.ts +++ b/src/vs/editor/browser/services/bulkEditService.ts @@ -7,22 +7,28 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { WorkspaceEdit } from 'vs/editor/common/modes'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IProgress, IProgressStep } from 'vs/platform/progress/common/progress'; +import { IDisposable } from 'vs/base/common/lifecycle'; export const IBulkEditService = createDecorator('IWorkspaceEditService'); - export interface IBulkEditOptions { editor?: ICodeEditor; progress?: IProgress; + showPreview?: boolean; + label?: string; } export interface IBulkEditResult { ariaSummary: string; } +export type IBulkEditPreviewHandler = (edit: WorkspaceEdit, options?: IBulkEditOptions) => Promise; + export interface IBulkEditService { _serviceBrand: undefined; + setPreviewHandler(handler: IBulkEditPreviewHandler): IDisposable; + apply(edit: WorkspaceEdit, options?: IBulkEditOptions): Promise; } diff --git a/src/vs/editor/browser/services/codeEditorService.ts b/src/vs/editor/browser/services/codeEditorService.ts index 0cfba7fd7fb..145cb9d2641 100644 --- a/src/vs/editor/browser/services/codeEditorService.ts +++ b/src/vs/editor/browser/services/codeEditorService.ts @@ -37,12 +37,13 @@ export interface ICodeEditorService { */ getFocusedCodeEditor(): ICodeEditor | null; - registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void; + registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string, editor?: ICodeEditor): void; removeDecorationType(key: string): void; resolveDecorationOptions(typeKey: string, writable: boolean): IModelDecorationOptions; setTransientModelProperty(model: ITextModel, key: string, value: any): void; getTransientModelProperty(model: ITextModel, key: string): any; + getTransientModelProperties(model: ITextModel): [string, any][] | undefined; getActiveCodeEditor(): ICodeEditor | null; openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise; diff --git a/src/vs/editor/browser/services/codeEditorServiceImpl.ts b/src/vs/editor/browser/services/codeEditorServiceImpl.ts index c7cf1da3f45..944a6d0f20f 100644 --- a/src/vs/editor/browser/services/codeEditorServiceImpl.ts +++ b/src/vs/editor/browser/services/codeEditorServiceImpl.ts @@ -14,31 +14,101 @@ import { IModelDecorationOptions, IModelDecorationOverviewRulerOptions, Overview import { IResourceInput } from 'vs/platform/editor/common/editor'; import { ITheme, IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService'; +class RefCountedStyleSheet { + + private readonly _parent: CodeEditorServiceImpl; + private readonly _editorId: string; + public readonly styleSheet: HTMLStyleElement; + private _refCount: number; + + constructor(parent: CodeEditorServiceImpl, editorId: string, styleSheet: HTMLStyleElement) { + this._parent = parent; + this._editorId = editorId; + this.styleSheet = styleSheet; + this._refCount = 0; + } + + public ref(): void { + this._refCount++; + } + + public unref(): void { + this._refCount--; + if (this._refCount === 0) { + this.styleSheet.parentNode?.removeChild(this.styleSheet); + this._parent._removeEditorStyleSheets(this._editorId); + } + } +} + +class GlobalStyleSheet { + public readonly styleSheet: HTMLStyleElement; + + constructor(styleSheet: HTMLStyleElement) { + this.styleSheet = styleSheet; + } + + public ref(): void { + } + + public unref(): void { + } +} + export abstract class CodeEditorServiceImpl extends AbstractCodeEditorService { - private readonly _styleSheet: HTMLStyleElement; + private _globalStyleSheet: GlobalStyleSheet | null; private readonly _decorationOptionProviders = new Map(); + private readonly _editorStyleSheets = new Map(); private readonly _themeService: IThemeService; - constructor(@IThemeService themeService: IThemeService, styleSheet = dom.createStyleSheet()) { + constructor(@IThemeService themeService: IThemeService, styleSheet: HTMLStyleElement | null = null) { super(); - this._styleSheet = styleSheet; + this._globalStyleSheet = styleSheet ? new GlobalStyleSheet(styleSheet) : null; this._themeService = themeService; } - public registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void { + private _getOrCreateGlobalStyleSheet(): GlobalStyleSheet { + if (!this._globalStyleSheet) { + this._globalStyleSheet = new GlobalStyleSheet(dom.createStyleSheet()); + } + return this._globalStyleSheet; + } + + private _getOrCreateStyleSheet(editor: ICodeEditor | undefined): GlobalStyleSheet | RefCountedStyleSheet { + if (!editor) { + return this._getOrCreateGlobalStyleSheet(); + } + const domNode = editor.getContainerDomNode(); + if (!dom.isInShadowDOM(domNode)) { + return this._getOrCreateGlobalStyleSheet(); + } + const editorId = editor.getId(); + if (!this._editorStyleSheets.has(editorId)) { + const refCountedStyleSheet = new RefCountedStyleSheet(this, editorId, dom.createStyleSheet(domNode)); + this._editorStyleSheets.set(editorId, refCountedStyleSheet); + } + return this._editorStyleSheets.get(editorId)!; + } + + _removeEditorStyleSheets(editorId: string): void { + this._editorStyleSheets.delete(editorId); + } + + public registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string, editor?: ICodeEditor): void { let provider = this._decorationOptionProviders.get(key); if (!provider) { + const styleSheet = this._getOrCreateStyleSheet(editor); const providerArgs: ProviderArguments = { - styleSheet: this._styleSheet, + styleSheet: styleSheet.styleSheet, key: key, parentTypeKey: parentTypeKey, options: options || Object.create(null) }; if (!parentTypeKey) { - provider = new DecorationTypeOptionsProvider(this._themeService, providerArgs); + provider = new DecorationTypeOptionsProvider(this._themeService, styleSheet, providerArgs); } else { - provider = new DecorationSubTypeOptionsProvider(this._themeService, providerArgs); + provider = new DecorationSubTypeOptionsProvider(this._themeService, styleSheet, providerArgs); } this._decorationOptionProviders.set(key, provider); } @@ -76,13 +146,16 @@ interface IModelDecorationOptionsProvider extends IDisposable { class DecorationSubTypeOptionsProvider implements IModelDecorationOptionsProvider { + private readonly _styleSheet: GlobalStyleSheet | RefCountedStyleSheet; public refCount: number; private readonly _parentTypeKey: string | undefined; private _beforeContentRules: DecorationCSSRules | null; private _afterContentRules: DecorationCSSRules | null; - constructor(themeService: IThemeService, providerArgs: ProviderArguments) { + constructor(themeService: IThemeService, styleSheet: GlobalStyleSheet | RefCountedStyleSheet, providerArgs: ProviderArguments) { + this._styleSheet = styleSheet; + this._styleSheet.ref(); this._parentTypeKey = providerArgs.parentTypeKey; this.refCount = 0; @@ -110,6 +183,7 @@ class DecorationSubTypeOptionsProvider implements IModelDecorationOptionsProvide this._afterContentRules.dispose(); this._afterContentRules = null; } + this._styleSheet.unref(); } } @@ -124,6 +198,7 @@ interface ProviderArguments { class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { private readonly _disposables = new DisposableStore(); + private readonly _styleSheet: GlobalStyleSheet | RefCountedStyleSheet; public refCount: number; public className: string | undefined; @@ -136,7 +211,9 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { public overviewRuler: IModelDecorationOverviewRulerOptions | undefined; public stickiness: TrackedRangeStickiness | undefined; - constructor(themeService: IThemeService, providerArgs: ProviderArguments) { + constructor(themeService: IThemeService, styleSheet: GlobalStyleSheet | RefCountedStyleSheet, providerArgs: ProviderArguments) { + this._styleSheet = styleSheet; + this._styleSheet.ref(); this.refCount = 0; const createCSSRules = (type: ModelDecorationCSSRuleType) => { @@ -202,6 +279,7 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { public dispose(): void { this._disposables.dispose(); + this._styleSheet.unref(); } } diff --git a/src/vs/editor/browser/view/domLineBreaksComputer.ts b/src/vs/editor/browser/view/domLineBreaksComputer.ts new file mode 100644 index 00000000000..ab567c36c9f --- /dev/null +++ b/src/vs/editor/browser/view/domLineBreaksComputer.ts @@ -0,0 +1,287 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { ILineBreaksComputerFactory, LineBreakData, ILineBreaksComputer } from 'vs/editor/common/viewModel/splitLinesCollection'; +import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; +import { FontInfo } from 'vs/editor/common/config/fontInfo'; +import { createStringBuilder, IStringBuilder } from 'vs/editor/common/core/stringBuilder'; +import { CharCode } from 'vs/base/common/charCode'; +import * as strings from 'vs/base/common/strings'; +import { Configuration } from 'vs/editor/browser/config/configuration'; + +export class DOMLineBreaksComputerFactory implements ILineBreaksComputerFactory { + + public static create(): DOMLineBreaksComputerFactory { + return new DOMLineBreaksComputerFactory(); + } + + constructor() { + } + + public createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer { + tabSize = tabSize | 0; //@perf + wrappingColumn = +wrappingColumn; //@perf + + let requests: string[] = []; + return { + addRequest: (lineText: string, previousLineBreakData: LineBreakData | null) => { + requests.push(lineText); + }, + finalize: () => { + return createLineBreaks(requests, fontInfo, tabSize, wrappingColumn, wrappingIndent); + } + }; + } +} + +function createLineBreaks(requests: string[], fontInfo: FontInfo, tabSize: number, firstLineBreakColumn: number, wrappingIndent: WrappingIndent): (LineBreakData | null)[] { + if (firstLineBreakColumn === -1) { + const result: null[] = []; + for (let i = 0, len = requests.length; i < len; i++) { + result[i] = null; + } + return result; + } + + const overallWidth = Math.round(firstLineBreakColumn * fontInfo.typicalHalfwidthCharacterWidth); + + // Cannot respect WrappingIndent.Indent and WrappingIndent.DeepIndent because that would require + // two dom layouts, in order to first set the width of the first line, and then set the width of the wrapped lines + if (wrappingIndent === WrappingIndent.Indent || wrappingIndent === WrappingIndent.DeepIndent) { + wrappingIndent = WrappingIndent.Same; + } + + const containerDomNode = document.createElement('div'); + Configuration.applyFontInfoSlow(containerDomNode, fontInfo); + + const sb = createStringBuilder(10000); + const firstNonWhitespaceIndices: number[] = []; + const wrappedTextIndentLengths: number[] = []; + const renderLineContents: string[] = []; + const allCharOffsets: number[][] = []; + const allVisibleColumns: number[][] = []; + for (let i = 0; i < requests.length; i++) { + const lineContent = requests[i]; + + let firstNonWhitespaceIndex = 0; + let wrappedTextIndentLength = 0; + let width = overallWidth; + + if (wrappingIndent !== WrappingIndent.None) { + firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent); + if (firstNonWhitespaceIndex === -1) { + // all whitespace line + firstNonWhitespaceIndex = 0; + + } else { + // Track existing indent + + for (let i = 0; i < firstNonWhitespaceIndex; i++) { + const charWidth = ( + lineContent.charCodeAt(i) === CharCode.Tab + ? (tabSize - (wrappedTextIndentLength % tabSize)) + : 1 + ); + wrappedTextIndentLength += charWidth; + } + + const indentWidth = Math.ceil(fontInfo.spaceWidth * wrappedTextIndentLength); + + // Force sticking to beginning of line if no character would fit except for the indentation + if (indentWidth + fontInfo.typicalFullwidthCharacterWidth > overallWidth) { + firstNonWhitespaceIndex = 0; + wrappedTextIndentLength = 0; + } else { + width = overallWidth - indentWidth; + } + } + } + + const renderLineContent = lineContent.substr(firstNonWhitespaceIndex); + const tmp = renderLine(renderLineContent, wrappedTextIndentLength, tabSize, width, sb); + firstNonWhitespaceIndices[i] = firstNonWhitespaceIndex; + wrappedTextIndentLengths[i] = wrappedTextIndentLength; + renderLineContents[i] = renderLineContent; + allCharOffsets[i] = tmp[0]; + allVisibleColumns[i] = tmp[1]; + } + containerDomNode.innerHTML = sb.build(); + + containerDomNode.style.position = 'absolute'; + containerDomNode.style.top = '10000'; + document.body.appendChild(containerDomNode); + + let range = document.createRange(); + const lineDomNodes = Array.prototype.slice.call(containerDomNode.children, 0); + + let result: (LineBreakData | null)[] = []; + for (let i = 0; i < requests.length; i++) { + const lineDomNode = lineDomNodes[i]; + const breakOffsets: number[] | null = readLineBreaks(range, lineDomNode, renderLineContents[i], allCharOffsets[i]); + if (breakOffsets === null) { + result[i] = null; + continue; + } + + const firstNonWhitespaceIndex = firstNonWhitespaceIndices[i]; + const wrappedTextIndentLength = wrappedTextIndentLengths[i]; + const visibleColumns = allVisibleColumns[i]; + + const breakOffsetsVisibleColumn: number[] = []; + for (let j = 0, len = breakOffsets.length; j < len; j++) { + breakOffsetsVisibleColumn[j] = visibleColumns[breakOffsets[j]]; + } + + if (firstNonWhitespaceIndex !== 0) { + // All break offsets are relative to the renderLineContent, make them absolute again + for (let j = 0, len = breakOffsets.length; j < len; j++) { + breakOffsets[j] += firstNonWhitespaceIndex; + } + } + + result[i] = new LineBreakData(breakOffsets, breakOffsetsVisibleColumn, wrappedTextIndentLength); + } + + document.body.removeChild(containerDomNode); + return result; +} + +function renderLine(lineContent: string, initialVisibleColumn: number, tabSize: number, width: number, sb: IStringBuilder): [number[], number[]] { + sb.appendASCIIString('
'); + // if (containsRTL) { + // sb.appendASCIIString('" dir="ltr'); + // } + + const len = lineContent.length; + let visibleColumn = initialVisibleColumn; + let charOffset = 0; + let charOffsets: number[] = []; + let visibleColumns: number[] = []; + let nextCharCode = (0 < len ? lineContent.charCodeAt(0) : CharCode.Null); + + for (let charIndex = 0; charIndex < len; charIndex++) { + charOffsets[charIndex] = charOffset; + visibleColumns[charIndex] = visibleColumn; + const charCode = nextCharCode; + nextCharCode = (charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : CharCode.Null); + let producedCharacters = 1; + let charWidth = 1; + switch (charCode) { + case CharCode.Tab: + producedCharacters = (tabSize - (visibleColumn % tabSize)); + charWidth = producedCharacters; + for (let space = 1; space <= producedCharacters; space++) { + if (space < producedCharacters) { + sb.write1(0xA0); //   + } else { + sb.appendASCII(CharCode.Space); + } + } + break; + + case CharCode.Space: + if (nextCharCode === CharCode.Space) { + sb.write1(0xA0); //   + } else { + sb.appendASCII(CharCode.Space); + } + break; + + case CharCode.LessThan: + sb.appendASCIIString('<'); + break; + + case CharCode.GreaterThan: + sb.appendASCIIString('>'); + break; + + case CharCode.Ampersand: + sb.appendASCIIString('&'); + break; + + case CharCode.Null: + sb.appendASCIIString('�'); + break; + + case CharCode.UTF8_BOM: + case CharCode.LINE_SEPARATOR_2028: + sb.write1(0xFFFD); + break; + + default: + if (strings.isFullWidthCharacter(charCode)) { + charWidth++; + } + // if (renderControlCharacters && charCode < 32) { + // sb.write1(9216 + charCode); + // } else { + sb.write1(charCode); + // } + } + + charOffset += producedCharacters; + visibleColumn += charWidth; + } + + charOffsets[lineContent.length] = charOffset; + visibleColumns[lineContent.length] = visibleColumn; + + sb.appendASCIIString('
'); + + return [charOffsets, visibleColumns]; +} + +function readLineBreaks(range: Range, lineDomNode: HTMLDivElement, lineContent: string, charOffsets: number[]): number[] | null { + if (lineContent.length <= 1) { + return null; + } + const textContentNode = lineDomNode.firstChild!; + + const breakOffsets: number[] = []; + discoverBreaks(range, textContentNode, charOffsets, 0, null, lineContent.length - 1, null, breakOffsets); + + if (breakOffsets.length === 0) { + return null; + } + + breakOffsets.push(lineContent.length); + return breakOffsets; +} + +type MaybeRects = ClientRectList | DOMRectList | null; + +function discoverBreaks(range: Range, textContentNode: Node, charOffsets: number[], low: number, lowRects: MaybeRects, high: number, highRects: MaybeRects, result: number[]): void { + if (low === high) { + return; + } + + lowRects = lowRects || readClientRect(range, textContentNode, charOffsets[low], charOffsets[low + 1]); + highRects = highRects || readClientRect(range, textContentNode, charOffsets[high], charOffsets[high + 1]); + + if (Math.abs(lowRects[0].top - highRects[0].top) <= 0.1) { + // same line + return; + } + + // there is at least one line break between these two offsets + if (low + 1 === high) { + // the two characters are adjacent, so the line break must be exactly between them + result.push(high); + return; + } + + const mid = low + ((high - low) / 2) | 0; + const midRects = readClientRect(range, textContentNode, charOffsets[mid], charOffsets[mid + 1]); + discoverBreaks(range, textContentNode, charOffsets, low, lowRects, mid, midRects, result); + discoverBreaks(range, textContentNode, charOffsets, mid, midRects, high, highRects, result); +} + +function readClientRect(range: Range, textContentNode: Node, startOffset: number, endOffset: number): ClientRectList | DOMRectList { + range.setStart(textContentNode, startOffset); + range.setEnd(textContentNode, endOffset); + return range.getClientRects(); +} diff --git a/src/vs/editor/browser/view/viewController.ts b/src/vs/editor/browser/view/viewController.ts index 9057fdfbe22..d2eb4bdd1f1 100644 --- a/src/vs/editor/browser/view/viewController.ts +++ b/src/vs/editor/browser/view/viewController.ts @@ -37,7 +37,7 @@ export interface IMouseDispatchData { export interface ICommandDelegate { executeEditorCommand(editorCommand: CoreEditorCommand, args: any): void; - paste(source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null): void; + paste(source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null): void; type(source: string, text: string): void; replacePreviousChar(source: string, text: string, replaceCharCnt: number): void; compositionStart(source: string): void; @@ -69,8 +69,8 @@ export class ViewController { this.commandDelegate.executeEditorCommand(editorCommand, args); } - public paste(source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null): void { - this.commandDelegate.paste(source, text, pasteOnNewLine, multicursorText); + public paste(source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null): void { + this.commandDelegate.paste(source, text, pasteOnNewLine, multicursorText, mode); } public type(source: string, text: string): void { diff --git a/src/vs/editor/browser/view/viewImpl.ts b/src/vs/editor/browser/view/viewImpl.ts index 28e858ea7e1..686436c9e71 100644 --- a/src/vs/editor/browser/view/viewImpl.ts +++ b/src/vs/editor/browser/view/viewImpl.ts @@ -11,7 +11,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { IPointerHandlerHelper } from 'vs/editor/browser/controller/mouseHandler'; import { PointerHandler } from 'vs/editor/browser/controller/pointerHandler'; import { ITextAreaHandlerHelper, TextAreaHandler } from 'vs/editor/browser/controller/textAreaHandler'; -import { IContentWidget, IContentWidgetPosition, IOverlayWidget, IOverlayWidgetPosition, IMouseTarget, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser'; +import { IContentWidget, IContentWidgetPosition, IOverlayWidget, IOverlayWidgetPosition, IMouseTarget, IViewZoneChangeAccessor, IEditorAriaOptions } from 'vs/editor/browser/editorBrowser'; import { ICommandDelegate, ViewController } from 'vs/editor/browser/view/viewController'; import { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents'; import { ContentViewOverlays, MarginViewOverlays } from 'vs/editor/browser/view/viewOverlays'; @@ -38,6 +38,7 @@ import { ViewCursors } from 'vs/editor/browser/viewParts/viewCursors/viewCursors import { ViewZones } from 'vs/editor/browser/viewParts/viewZones/viewZones'; import { Cursor } from 'vs/editor/common/controller/cursor'; import { Position } from 'vs/editor/common/core/position'; +import { Range } from 'vs/editor/common/core/range'; import { IConfiguration } from 'vs/editor/common/editorCommon'; import { RenderingContext } from 'vs/editor/common/view/renderingContext'; import { ViewContext } from 'vs/editor/common/view/viewContext'; @@ -308,6 +309,10 @@ export class View extends ViewEventHandler { this._applyLayout(); return false; } + public onContentSizeChanged(e: viewEvents.ViewContentSizeChangedEvent): boolean { + this.outgoingEvents.emitContentSizeChange(e); + return false; + } public onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean { this.domNode.setClassName(this.getEditorClassName()); this._context.model.setHasFocus(e.isFocused); @@ -510,6 +515,10 @@ export class View extends ViewEventHandler { this._textAreaHandler.refreshFocusState(); } + public setAriaOptions(options: IEditorAriaOptions): void { + this._textAreaHandler.setAriaOptions(options); + } + public addContentWidget(widgetData: IContentWidgetData): void { this.contentWidgets.addWidget(widgetData.widget); this.layoutContentWidget(widgetData); @@ -517,10 +526,15 @@ export class View extends ViewEventHandler { } public layoutContentWidget(widgetData: IContentWidgetData): void { - const newPosition = widgetData.position ? widgetData.position.position : null; - const newRange = widgetData.position ? widgetData.position.range || null : null; + let newRange = widgetData.position ? widgetData.position.range || null : null; + if (newRange === null) { + const newPosition = widgetData.position ? widgetData.position.position : null; + if (newPosition !== null) { + newRange = new Range(newPosition.lineNumber, newPosition.column, newPosition.lineNumber, newPosition.column); + } + } const newPreference = widgetData.position ? widgetData.position.preference : null; - this.contentWidgets.setWidgetPosition(widgetData.widget, newPosition, newRange, newPreference); + this.contentWidgets.setWidgetPosition(widgetData.widget, newRange, newPreference); this._scheduleRender(); } @@ -559,4 +573,3 @@ function safeInvokeNoArg(func: Function): any { onUnexpectedError(e); } } - diff --git a/src/vs/editor/browser/view/viewOutgoingEvents.ts b/src/vs/editor/browser/view/viewOutgoingEvents.ts index 8a39ae53519..6ba6ff3f123 100644 --- a/src/vs/editor/browser/view/viewOutgoingEvents.ts +++ b/src/vs/editor/browser/view/viewOutgoingEvents.ts @@ -9,7 +9,7 @@ import { MouseTarget } from 'vs/editor/browser/controller/mouseTarget'; import { IEditorMouseEvent, IMouseTarget, IPartialEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { IScrollEvent } from 'vs/editor/common/editorCommon'; +import { IScrollEvent, IContentSizeChangedEvent } from 'vs/editor/common/editorCommon'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { IViewModel, ICoordinatesConverter } from 'vs/editor/common/viewModel/viewModel'; import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent'; @@ -20,6 +20,7 @@ export interface EventCallback { export class ViewOutgoingEvents extends Disposable { + public onDidContentSizeChange: EventCallback | null = null; public onDidScroll: EventCallback | null = null; public onDidGainFocus: EventCallback | null = null; public onDidLoseFocus: EventCallback | null = null; @@ -41,6 +42,12 @@ export class ViewOutgoingEvents extends Disposable { this._viewModel = viewModel; } + public emitContentSizeChange(e: viewEvents.ViewContentSizeChangedEvent): void { + if (this.onDidContentSizeChange) { + this.onDidContentSizeChange(e); + } + } + public emitScrollChanged(e: viewEvents.ViewScrollChangedEvent): void { if (this.onDidScroll) { this.onDidScroll(e); diff --git a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts index e98cea19e9c..59253aaf557 100644 --- a/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts +++ b/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts @@ -7,7 +7,6 @@ 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 { IPosition, Position } from 'vs/editor/common/core/position'; import { IRange, Range } from 'vs/editor/common/core/range'; import { Constants } from 'vs/base/common/uint'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; @@ -112,9 +111,9 @@ export class ViewContentWidgets extends ViewPart { this.setShouldRender(); } - public setWidgetPosition(widget: IContentWidget, position: IPosition | null, range: IRange | null, preference: ContentWidgetPositionPreference[] | null): void { + public setWidgetPosition(widget: IContentWidget, range: IRange | null, preference: ContentWidgetPositionPreference[] | null): void { const myWidget = this._widgets[widget.getId()]; - myWidget.setPosition(position, range, preference); + myWidget.setPosition(range, preference); this.setShouldRender(); } @@ -187,8 +186,6 @@ class Widget { private _contentLeft: number; private _lineHeight: number; - private _position: IPosition | null; - private _viewPosition: Position | null; private _range: IRange | null; private _viewRange: Range | null; private _preference: ContentWidgetPositionPreference[] | null; @@ -217,9 +214,7 @@ class Widget { this._contentLeft = layoutInfo.contentLeft; this._lineHeight = options.get(EditorOption.lineHeight); - this._position = null; this._range = null; - this._viewPosition = null; this._viewRange = null; this._preference = []; this._cachedDomNodeClientWidth = -1; @@ -246,26 +241,19 @@ class Widget { } public onLineMappingChanged(e: viewEvents.ViewLineMappingChangedEvent): void { - this._setPosition(this._position, this._range); + this._setPosition(this._range); } - private _setPosition(position: IPosition | null, range: IRange | null): void { - this._position = position; + private _setPosition(range: IRange | null): void { this._range = range; - this._viewPosition = null; this._viewRange = null; - if (this._position) { - // Do not trust that widgets give a valid position - const validModelPosition = this._context.model.validateModelPosition(this._position); - if (this._context.model.coordinatesConverter.modelPositionIsVisible(validModelPosition)) { - this._viewPosition = this._context.model.coordinatesConverter.convertModelPositionToViewPosition(validModelPosition); - } - } if (this._range) { // Do not trust that widgets give a valid position const validModelRange = this._context.model.validateModelRange(this._range); - this._viewRange = this._context.model.coordinatesConverter.convertModelRangeToViewRange(validModelRange); + if (this._context.model.coordinatesConverter.modelPositionIsVisible(validModelRange.getStartPosition()) || this._context.model.coordinatesConverter.modelPositionIsVisible(validModelRange.getEndPosition())) { + this._viewRange = this._context.model.coordinatesConverter.convertModelRangeToViewRange(validModelRange); + } } } @@ -277,8 +265,8 @@ class Widget { ); } - public setPosition(position: IPosition | null, range: IRange | null, preference: ContentWidgetPositionPreference[] | null): void { - this._setPosition(position, range); + public setPosition(range: IRange | null, preference: ContentWidgetPositionPreference[] | null): void { + this._setPosition(range); this._preference = preference; this._cachedDomNodeClientWidth = -1; this._cachedDomNodeClientHeight = -1; @@ -327,60 +315,65 @@ class Widget { }; } - private _layoutBoxInPage(topLeft: Coordinate, bottomLeft: Coordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null { - const aboveLeft0 = topLeft.left - ctx.scrollLeft; - const belowLeft0 = bottomLeft.left - ctx.scrollLeft; + private _layoutHorizontalSegmentInPage(windowSize: dom.Dimension, domNodePosition: dom.IDomNodePagePosition, left: number, width: number): [number, number] { + const MIN_LIMIT = (width <= domNodePosition.width - 20 ? domNodePosition.left : 0); + const MAX_LIMIT = (width <= domNodePosition.width - 20 ? domNodePosition.left + domNodePosition.width - 20 : windowSize.width - 20); - let aboveTop = topLeft.top - height; - let belowTop = bottomLeft.top + this._lineHeight; - let aboveLeft = aboveLeft0 + this._contentLeft; - let belowLeft = belowLeft0 + this._contentLeft; + let absoluteLeft = domNodePosition.left + left - dom.StandardWindow.scrollX; + + if (absoluteLeft + width > MAX_LIMIT) { + const delta = absoluteLeft - (MAX_LIMIT - width); + absoluteLeft -= delta; + left -= delta; + } + + if (absoluteLeft < MIN_LIMIT) { + const delta = absoluteLeft - MIN_LIMIT; + absoluteLeft -= delta; + left -= delta; + } + + return [left, absoluteLeft]; + } + + private _layoutBoxInPage(topLeft: Coordinate, bottomLeft: Coordinate, width: number, height: number, ctx: RenderingContext): IBoxLayoutResult | null { + const aboveTop = topLeft.top - height; + const belowTop = bottomLeft.top + this._lineHeight; const domNodePosition = dom.getDomNodePagePosition(this._viewDomNode.domNode); const absoluteAboveTop = domNodePosition.top + aboveTop - dom.StandardWindow.scrollY; const absoluteBelowTop = domNodePosition.top + belowTop - dom.StandardWindow.scrollY; - let absoluteAboveLeft = domNodePosition.left + aboveLeft - dom.StandardWindow.scrollX; - let absoluteBelowLeft = domNodePosition.left + belowLeft - dom.StandardWindow.scrollX; - const INNER_WIDTH = window.innerWidth || document.documentElement!.clientWidth || document.body.clientWidth; - const INNER_HEIGHT = window.innerHeight || document.documentElement!.clientHeight || document.body.clientHeight; + const windowSize = dom.getClientArea(document.body); + const [aboveLeft, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, topLeft.left - ctx.scrollLeft + this._contentLeft, width); + const [belowLeft, absoluteBelowLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, bottomLeft.left - ctx.scrollLeft + this._contentLeft, width); - // Leave some clearance to the bottom + // Leave some clearance to the top/bottom const TOP_PADDING = 22; const BOTTOM_PADDING = 22; - const fitsAbove = (absoluteAboveTop >= TOP_PADDING), - fitsBelow = (absoluteBelowTop + height <= INNER_HEIGHT - BOTTOM_PADDING); - - if (absoluteAboveLeft + width + 20 > INNER_WIDTH) { - const delta = absoluteAboveLeft - (INNER_WIDTH - width - 20); - absoluteAboveLeft -= delta; - aboveLeft -= delta; - } - if (absoluteBelowLeft + width + 20 > INNER_WIDTH) { - const delta = absoluteBelowLeft - (INNER_WIDTH - width - 20); - absoluteBelowLeft -= delta; - belowLeft -= delta; - } - if (absoluteAboveLeft < 0) { - const delta = absoluteAboveLeft; - absoluteAboveLeft -= delta; - aboveLeft -= delta; - } - if (absoluteBelowLeft < 0) { - const delta = absoluteBelowLeft; - absoluteBelowLeft -= delta; - belowLeft -= delta; - } + const fitsAbove = (absoluteAboveTop >= TOP_PADDING); + const fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING); if (this._fixedOverflowWidgets) { - aboveTop = absoluteAboveTop; - belowTop = absoluteBelowTop; - aboveLeft = absoluteAboveLeft; - belowLeft = absoluteBelowLeft; + return { + fitsAbove, + aboveTop: Math.max(absoluteAboveTop, TOP_PADDING), + aboveLeft: absoluteAboveLeft, + fitsBelow, + belowTop: absoluteBelowTop, + belowLeft: absoluteBelowLeft + }; } - return { fitsAbove, aboveTop: Math.max(aboveTop, TOP_PADDING), aboveLeft, fitsBelow, belowTop, belowLeft }; + return { + fitsAbove, + aboveTop: Math.max(aboveTop, TOP_PADDING), + aboveLeft, + fitsBelow, + belowTop, + belowLeft + }; } private _prepareRenderWidgetAtExactPositionOverflowing(topLeft: Coordinate): Coordinate { @@ -391,45 +384,45 @@ class Widget { * Compute `this._topLeft` */ private _getTopAndBottomLeft(ctx: RenderingContext): [Coordinate, Coordinate] | [null, null] { - if (!this._viewPosition) { + if (!this._viewRange) { return [null, null]; } - const visibleRangeForPosition = ctx.visibleRangeForPosition(this._viewPosition); - if (!visibleRangeForPosition) { + const visibleRangesForRange = ctx.linesVisibleRangesForRange(this._viewRange, false); + if (!visibleRangesForRange || visibleRangesForRange.length === 0) { return [null, null]; } - const topForPosition = ctx.getVerticalOffsetForLineNumber(this._viewPosition.lineNumber) - ctx.scrollTop; - const topLeft = new Coordinate(topForPosition, visibleRangeForPosition.left); - - let largestLineNumber = this._viewPosition.lineNumber; - let smallestLeft = visibleRangeForPosition.left; - - if (this._viewRange) { - const visibleRangesForRange = ctx.linesVisibleRangesForRange(this._viewRange, false); - if (visibleRangesForRange && visibleRangesForRange.length > 0) { - for (let i = visibleRangesForRange.length - 1; i >= 0; i--) { - const visibleRangesForLine = visibleRangesForRange[i]; - if (visibleRangesForLine.lineNumber >= largestLineNumber) { - if (visibleRangesForLine.lineNumber > largestLineNumber) { - largestLineNumber = visibleRangesForLine.lineNumber; - smallestLeft = Constants.MAX_SAFE_SMALL_INTEGER; - } - for (let j = 0, lenJ = visibleRangesForLine.ranges.length; j < lenJ; j++) { - const visibleRange = visibleRangesForLine.ranges[j]; - - if (visibleRange.left < smallestLeft) { - smallestLeft = visibleRange.left; - } - } - } - } + let firstLine = visibleRangesForRange[0]; + let lastLine = visibleRangesForRange[0]; + for (const visibleRangesForLine of visibleRangesForRange) { + if (visibleRangesForLine.lineNumber < firstLine.lineNumber) { + firstLine = visibleRangesForLine; + } + if (visibleRangesForLine.lineNumber > lastLine.lineNumber) { + lastLine = visibleRangesForLine; } } - const topForBottomLine = ctx.getVerticalOffsetForLineNumber(largestLineNumber) - ctx.scrollTop; - const bottomLeft = new Coordinate(topForBottomLine, smallestLeft); + let firstLineMinLeft = Constants.MAX_SAFE_SMALL_INTEGER;//firstLine.Constants.MAX_SAFE_SMALL_INTEGER; + for (const visibleRange of firstLine.ranges) { + if (visibleRange.left < firstLineMinLeft) { + firstLineMinLeft = visibleRange.left; + } + } + + let lastLineMinLeft = Constants.MAX_SAFE_SMALL_INTEGER;//lastLine.Constants.MAX_SAFE_SMALL_INTEGER; + for (const visibleRange of lastLine.ranges) { + if (visibleRange.left < lastLineMinLeft) { + lastLineMinLeft = visibleRange.left; + } + } + + const topForPosition = ctx.getVerticalOffsetForLineNumber(firstLine.lineNumber) - ctx.scrollTop; + const topLeft = new Coordinate(topForPosition, firstLineMinLeft); + + const topForBottomLine = ctx.getVerticalOffsetForLineNumber(lastLine.lineNumber) - ctx.scrollTop; + const bottomLeft = new Coordinate(topForBottomLine, lastLineMinLeft); return [topLeft, bottomLeft]; } @@ -491,11 +484,11 @@ class Widget { * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly. */ public onBeforeRender(viewportData: ViewportData): void { - if (!this._viewPosition || !this._preference) { + if (!this._viewRange || !this._preference) { return; } - if (this._viewPosition.lineNumber < viewportData.startLineNumber || this._viewPosition.lineNumber > viewportData.endLineNumber) { + if (this._viewRange.endLineNumber < viewportData.startLineNumber || this._viewRange.startLineNumber > viewportData.endLineNumber) { // Outside of viewport return; } diff --git a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts index 11a01c1eb11..73a755d84d8 100644 --- a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts +++ b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts @@ -56,7 +56,7 @@ export class EditorScrollbar extends ViewPart { fastScrollSensitivity: fastScrollSensitivity, }; - this.scrollbar = this._register(new SmoothScrollableElement(linesContent.domNode, scrollbarOptions, this._context.viewLayout.scrollable)); + this.scrollbar = this._register(new SmoothScrollableElement(linesContent.domNode, scrollbarOptions, this._context.viewLayout.getScrollable())); PartFingerprints.write(this.scrollbar.getDomNode(), PartFingerprint.ScrollableElement); this.scrollbarDomNode = createFastDomNode(this.scrollbar.getDomNode()); @@ -113,7 +113,7 @@ export class EditorScrollbar extends ViewPart { } else { this.scrollbarDomNode.setWidth(layoutInfo.contentWidth); } - this.scrollbarDomNode.setHeight(layoutInfo.contentHeight); + this.scrollbarDomNode.setHeight(layoutInfo.height); } public getOverviewRulerLayoutInfo(): IOverviewRulerLayoutInfo { diff --git a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts index 6af61888a62..33979994f9d 100644 --- a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts +++ b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts @@ -136,14 +136,16 @@ export class IndentGuidesOverlay extends DynamicViewOverlay { const indent = indents[lineIndex]; let result = ''; - const leftMostVisiblePosition = ctx.visibleRangeForPosition(new Position(lineNumber, 1)); - let left = leftMostVisiblePosition ? leftMostVisiblePosition.left : 0; - for (let i = 1; i <= indent; i++) { - const className = (containsActiveIndentGuide && i === activeIndentLevel ? 'cigra' : 'cigr'); - result += `
`; - left += indentWidth; - if (left > scrollWidth || (this._maxIndentLeft > 0 && left > this._maxIndentLeft)) { - break; + if (indent >= 1) { + const leftMostVisiblePosition = ctx.visibleRangeForPosition(new Position(lineNumber, 1)); + let left = leftMostVisiblePosition ? leftMostVisiblePosition.left : 0; + for (let i = 1; i <= indent; i++) { + const className = (containsActiveIndentGuide && i === activeIndentLevel ? 'cigra' : 'cigr'); + result += `
`; + left += indentWidth; + if (left > scrollWidth || (this._maxIndentLeft > 0 && left > this._maxIndentLeft)) { + break; + } } } diff --git a/src/vs/editor/browser/viewParts/lines/viewLine.ts b/src/vs/editor/browser/viewParts/lines/viewLine.ts index 8840a014032..c5d0ca15317 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLine.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLine.ts @@ -73,6 +73,7 @@ export class ViewLineOptions { public readonly renderWhitespace: 'none' | 'boundary' | 'selection' | 'all'; public readonly renderControlCharacters: boolean; public readonly spaceWidth: number; + public readonly middotWidth: number; public readonly useMonospaceOptimizations: boolean; public readonly canUseHalfwidthRightwardsArrow: boolean; public readonly lineHeight: number; @@ -86,6 +87,7 @@ export class ViewLineOptions { this.renderWhitespace = options.get(EditorOption.renderWhitespace); this.renderControlCharacters = options.get(EditorOption.renderControlCharacters); this.spaceWidth = fontInfo.spaceWidth; + this.middotWidth = fontInfo.middotWidth; this.useMonospaceOptimizations = ( fontInfo.isMonospace && !options.get(EditorOption.disableMonospaceOptimizations) @@ -102,6 +104,7 @@ export class ViewLineOptions { && this.renderWhitespace === other.renderWhitespace && this.renderControlCharacters === other.renderControlCharacters && this.spaceWidth === other.spaceWidth + && this.middotWidth === other.middotWidth && this.useMonospaceOptimizations === other.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow && this.lineHeight === other.lineHeight @@ -213,7 +216,9 @@ export class ViewLine implements IVisibleLine { lineData.tokens, actualInlineDecorations, lineData.tabSize, + lineData.startVisibleColumn, options.spaceWidth, + options.middotWidth, options.stopRenderingLineAfter, options.renderWhitespace, options.renderControlCharacters, @@ -513,9 +518,16 @@ class RenderedViewLine implements IRenderedViewLine { return 0; } if (this._containsForeignElements === ForeignElementType.Before) { - // We have foreign element before the (empty) line + // We have foreign elements before the (empty) line return this.getWidth(); } + // We have foreign elements before & after the (empty) line + const readingTarget = this._getReadingTarget(domNode); + if (readingTarget.firstChild) { + return (readingTarget.firstChild).offsetWidth; + } else { + return 0; + } } if (this._pixelOffsetCache !== null) { diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index b2b451023ee..eb259b3fb9c 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -126,8 +126,8 @@ class MinimapOptions { this.minimapWidth = layoutInfo.minimapWidth; this.minimapHeight = layoutInfo.height; - this.canvasInnerWidth = Math.max(1, Math.floor(pixelRatio * this.minimapWidth)); - this.canvasInnerHeight = Math.max(1, Math.floor(pixelRatio * this.minimapHeight)); + this.canvasInnerWidth = Math.floor(pixelRatio * this.minimapWidth); + this.canvasInnerHeight = Math.floor(pixelRatio * this.minimapHeight); this.canvasOuterWidth = this.canvasInnerWidth / pixelRatio; this.canvasOuterHeight = this.canvasInnerHeight / pixelRatio; @@ -555,6 +555,8 @@ export class Minimap extends ViewPart { this._slider.toggleClassName('active', true); this._sliderMouseMoveMonitor.startMonitoring( + e.target, + e.buttons, standardMouseMoveMerger, (mouseMoveData: IStandardMouseMoveEventData) => { const mouseOrthogonalDelta = Math.abs(mouseMoveData.posx - initialMouseOrthogonalPosition); @@ -655,16 +657,18 @@ export class Minimap extends ViewPart { this._slider.setWidth(this._options.minimapWidth); } - private _getBuffer(): ImageData { + private _getBuffer(): ImageData | null { if (!this._buffers) { - this._buffers = new MinimapBuffers( - this._canvas.domNode.getContext('2d')!, - this._options.canvasInnerWidth, - this._options.canvasInnerHeight, - this._tokensColorTracker.getColor(ColorId.DefaultBackground) - ); + if (this._options.canvasInnerWidth > 0 && this._options.canvasInnerHeight > 0) { + this._buffers = new MinimapBuffers( + this._canvas.domNode.getContext('2d')!, + this._options.canvasInnerWidth, + this._options.canvasInnerHeight, + this._tokensColorTracker.getColor(ColorId.DefaultBackground) + ); + } } - return this._buffers!.getBuffer(); + return this._buffers ? this._buffers.getBuffer() : null; } private _onOptionsMaybeChanged(): boolean { @@ -852,7 +856,7 @@ export class Minimap extends ViewPart { const y = (lineNumber - layout.startLineNumber) * lineHeight; // Skip rendering the line if it's vertically outside our viewport - if (y + height < 0 || y > this._options.canvasOuterHeight) { + if (y + height < 0 || y > this._options.canvasInnerHeight) { return; } @@ -904,7 +908,7 @@ export class Minimap extends ViewPart { canvasContext.fillRect(x, y, width, height); } - private renderLines(layout: MinimapLayout): RenderData { + private renderLines(layout: MinimapLayout): RenderData | null { const renderMinimap = this._options.renderMinimap; const charRenderer = this._options.charRenderer(); const startLineNumber = layout.startLineNumber; @@ -921,6 +925,10 @@ export class Minimap extends ViewPart { // Oh well!! We need to repaint some lines... const imageData = this._getBuffer(); + if (!imageData) { + // 0 width or 0 height canvas, nothing to do + return null; + } // Render untouched lines by using last rendered data. let [_dirtyY1, _dirtyY2, needed] = Minimap._renderUntouchedLines( diff --git a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts index 687b9985268..3e57c3f2f94 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts @@ -74,8 +74,14 @@ class Settings { this.right = position.right; this.domWidth = position.width; this.domHeight = position.height; - this.canvasWidth = (this.domWidth * this.pixelRatio) | 0; - this.canvasHeight = (this.domHeight * this.pixelRatio) | 0; + if (this.overviewRulerLanes === 0) { + // overview ruler is off + this.canvasWidth = 0; + this.canvasHeight = 0; + } else { + this.canvasWidth = (this.domWidth * this.pixelRatio) | 0; + this.canvasHeight = (this.domHeight * this.pixelRatio) | 0; + } const [x, w] = this._initLanes(1, this.canvasWidth, this.overviewRulerLanes); this.x = x; @@ -303,6 +309,11 @@ export class DecorationsOverviewRuler extends ViewPart { } private _render(): void { + if (this._settings.overviewRulerLanes === 0) { + // overview ruler is off + this._domNode.setBackgroundColor(this._settings.backgroundColor ? this._settings.backgroundColor : ''); + return; + } const canvasWidth = this._settings.canvasWidth; const canvasHeight = this._settings.canvasHeight; const lineHeight = this._settings.lineHeight; diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 3d75cc67df5..0881cd7107f 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -22,7 +22,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService import { ICommandDelegate } from 'vs/editor/browser/view/viewController'; import { IContentWidgetData, IOverlayWidgetData, View } from 'vs/editor/browser/view/viewImpl'; import { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents'; -import { ConfigurationChangedEvent, EditorLayoutInfo, IEditorOptions, EditorOption, IComputedEditorOptions, FindComputedEditorOptionValueById, IEditorConstructionOptions } from 'vs/editor/common/config/editorOptions'; +import { ConfigurationChangedEvent, EditorLayoutInfo, IEditorOptions, EditorOption, IComputedEditorOptions, FindComputedEditorOptionValueById, IEditorConstructionOptions, filterValidationDecorations } from 'vs/editor/common/config/editorOptions'; import { Cursor, CursorStateChangedEvent } from 'vs/editor/common/controller/cursor'; import { CursorColumns, ICursors } from 'vs/editor/common/controller/cursorCommon'; import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; @@ -50,6 +50,8 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { withNullAsUndefined } from 'vs/base/common/types'; +import { MonospaceLineBreaksComputerFactory } from 'vs/editor/common/viewModel/monospaceLineBreaksComputer'; +import { DOMLineBreaksComputerFactory } from 'vs/editor/browser/view/domLineBreaksComputer'; let EDITOR_ID = 0; @@ -154,13 +156,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE private readonly _onDidType: Emitter = this._register(new Emitter()); public readonly onDidType = this._onDidType.event; - private readonly _onCompositionStart: Emitter = this._register(new Emitter()); - public readonly onCompositionStart = this._onCompositionStart.event; + private readonly _onDidCompositionStart: Emitter = this._register(new Emitter()); + public readonly onDidCompositionStart = this._onDidCompositionStart.event; - private readonly _onCompositionEnd: Emitter = this._register(new Emitter()); - public readonly onCompositionEnd = this._onCompositionEnd.event; + private readonly _onDidCompositionEnd: Emitter = this._register(new Emitter()); + public readonly onDidCompositionEnd = this._onDidCompositionEnd.event; - private readonly _onDidPaste: Emitter = this._register(new Emitter()); + private readonly _onDidPaste: Emitter = this._register(new Emitter()); public readonly onDidPaste = this._onDidPaste.event; private readonly _onMouseUp: Emitter = this._register(new Emitter()); @@ -193,6 +195,9 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE private readonly _onKeyDown: Emitter = this._register(new Emitter()); public readonly onKeyDown: Event = this._onKeyDown.event; + private readonly _onDidContentSizeChange: Emitter = this._register(new Emitter()); + public readonly onDidContentSizeChange: Event = this._onDidContentSizeChange.event; + private readonly _onDidScrollChange: Emitter = this._register(new Emitter()); public readonly onDidScrollChange: Event = this._onDidScrollChange.event; @@ -764,6 +769,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE return this._modelData.viewModel.viewLayout.getLinesTotalHeight(); } + public getContentWidth(): number { + if (!this._modelData) { + return -1; + } + return this._modelData.viewModel.viewLayout.getContentWidth(); + } + public getScrollWidth(): number { if (!this._modelData) { return -1; @@ -777,6 +789,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE return this._modelData.viewModel.viewLayout.getCurrentScrollLeft(); } + public getContentHeight(): number { + if (!this._modelData) { + return -1; + } + return this._modelData.viewModel.viewLayout.getContentHeight(); + } + public getScrollHeight(): number { if (!this._modelData) { return -1; @@ -938,19 +957,15 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE const endPosition = this._modelData.cursor.getSelection().getStartPosition(); if (source === 'keyboard') { this._onDidPaste.fire( - new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column) + { + range: new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column), + mode: payload.mode + } ); } return; } - if (handlerId === editorCommon.Handler.CompositionStart) { - this._onCompositionStart.fire(); - } - if (handlerId === editorCommon.Handler.CompositionEnd) { - this._onCompositionEnd.fire(); - } - const action = this.getAction(handlerId); if (action) { Promise.resolve(action.run()).then(undefined, onUnexpectedError); @@ -966,6 +981,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE } this._modelData.cursor.trigger(source, handlerId, payload); + + if (handlerId === editorCommon.Handler.CompositionStart) { + this._onDidCompositionStart.fire(); + } + if (handlerId === editorCommon.Handler.CompositionEnd) { + this._onDidCompositionEnd.fire(); + } } private _triggerEditorCommand(source: string, handlerId: string, payload: any): boolean { @@ -1049,7 +1071,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE if (!this._modelData) { return null; } - return this._modelData.model.getLineDecorations(lineNumber, this._id, this._configuration.options.get(EditorOption.readOnly)); + return this._modelData.model.getLineDecorations(lineNumber, this._id, filterValidationDecorations(this._configuration.options)); } public deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[] { @@ -1153,6 +1175,10 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE return this._modelData.view.createOverviewRuler(cssClassName); } + public getContainerDomNode(): HTMLElement { + return this._domElement; + } + public getDomNode(): HTMLElement | null { if (!this._modelData || !this._modelData.hasRealView) { return null; @@ -1318,6 +1344,13 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE this._modelData.view.render(true, forceRedraw); } + public setAriaOptions(options: editorBrowser.IEditorAriaOptions): void { + if (!this._modelData || !this._modelData.hasRealView) { + return; + } + this._modelData.view.setAriaOptions(options); + } + public applyFontInfo(target: HTMLElement): void { Configuration.applyFontInfoSlow(target, this._configuration.options.get(EditorOption.fontInfo)); } @@ -1336,7 +1369,14 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE model.onBeforeAttached(); - const viewModel = new ViewModel(this._id, this._configuration, model, (callback) => dom.scheduleAtNextAnimationFrame(callback)); + const viewModel = new ViewModel( + this._id, + this._configuration, + model, + DOMLineBreaksComputerFactory.create(), + MonospaceLineBreaksComputerFactory.create(this._configuration.options), + (callback) => dom.scheduleAtNextAnimationFrame(callback) + ); listenersToRemove.push(model.onDidChangeDecorations((e) => this._onDidChangeModelDecorations.fire(e))); listenersToRemove.push(model.onDidChangeLanguage((e) => { @@ -1415,8 +1455,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE executeEditorCommand: (editorCommand: CoreEditorCommand, args: any): void => { editorCommand.runCoreEditorCommand(cursor, args); }, - paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null) => { - this.trigger(source, editorCommon.Handler.Paste, { text, pasteOnNewLine, multicursorText }); + paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null) => { + this.trigger(source, editorCommon.Handler.Paste, { text, pasteOnNewLine, multicursorText, mode }); }, type: (source: string, text: string) => { this.trigger(source, editorCommon.Handler.Type, { text }); @@ -1439,11 +1479,12 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE executeEditorCommand: (editorCommand: CoreEditorCommand, args: any): void => { editorCommand.runCoreEditorCommand(cursor, args); }, - paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null) => { + paste: (source: string, text: string, pasteOnNewLine: boolean, multicursorText: string[] | null, mode: string | null) => { this._commandService.executeCommand(editorCommon.Handler.Paste, { text: text, pasteOnNewLine: pasteOnNewLine, - multicursorText: multicursorText + multicursorText: multicursorText, + mode }); }, type: (source: string, text: string) => { @@ -1470,6 +1511,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE } const viewOutgoingEvents = new ViewOutgoingEvents(viewModel); + viewOutgoingEvents.onDidContentSizeChange = (e) => this._onDidContentSizeChange.fire(e); viewOutgoingEvents.onDidScroll = (e) => this._onDidScrollChange.fire(e); viewOutgoingEvents.onDidGainFocus = () => this._editorTextFocus.setValue(true); viewOutgoingEvents.onDidLoseFocus = () => this._editorTextFocus.setValue(false); @@ -1526,7 +1568,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE } private _registerDecorationType(key: string, options: editorCommon.IDecorationRenderOptions, parentTypeKey?: string): void { - this._codeEditorService.registerDecorationType(key, options, parentTypeKey); + this._codeEditorService.registerDecorationType(key, options, parentTypeKey, this); } private _removeDecorationType(key: string): void { diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index 91b91732033..fe47a578263 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -1124,11 +1124,11 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE let scrollTop = this.modifiedEditor.getScrollTop(); let scrollHeight = this.modifiedEditor.getScrollHeight(); - let computedAvailableSize = Math.max(0, layoutInfo.contentHeight); + let computedAvailableSize = Math.max(0, layoutInfo.height); let computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0); let computedRatio = scrollHeight > 0 ? (computedRepresentableSize / scrollHeight) : 0; - let computedSliderSize = Math.max(0, Math.floor(layoutInfo.contentHeight * computedRatio)); + let computedSliderSize = Math.max(0, Math.floor(layoutInfo.height * computedRatio)); let computedSliderPosition = Math.floor(scrollTop * computedRatio); return { @@ -1611,7 +1611,7 @@ const DECORATIONS = { }), lineInsertWithSign: ModelDecorationOptions.register({ className: 'line-insert', - linesDecorationsClassName: 'insert-sign', + linesDecorationsClassName: 'insert-sign codicon codicon-add', marginClassName: 'line-insert', isWholeLine: true }), @@ -1623,7 +1623,7 @@ const DECORATIONS = { }), lineDeleteWithSign: ModelDecorationOptions.register({ className: 'line-delete', - linesDecorationsClassName: 'delete-sign', + linesDecorationsClassName: 'delete-sign codicon codicon-remove', marginClassName: 'line-delete', isWholeLine: true @@ -2082,7 +2082,7 @@ class InlineViewZonesComputer extends ViewZonesComputer { if (this.renderIndicators) { let index = lineNumber - lineChange.originalStartLineNumber; marginHTML = marginHTML.concat([ - `
` + `
` ]); } } @@ -2144,7 +2144,9 @@ class InlineViewZonesComputer extends ViewZonesComputer { lineTokens, actualDecorations, tabSize, + 0, fontInfo.spaceWidth, + fontInfo.middotWidth, options.get(EditorOption.stopRenderingLineAfter), options.get(EditorOption.renderWhitespace), options.get(EditorOption.renderControlCharacters), diff --git a/src/vs/editor/browser/widget/diffReview.ts b/src/vs/editor/browser/widget/diffReview.ts index b0437b6d47f..3540ddbaacd 100644 --- a/src/vs/editor/browser/widget/diffReview.ts +++ b/src/vs/editor/browser/widget/diffReview.ts @@ -780,7 +780,9 @@ export class DiffReview extends Disposable { lineTokens, [], tabSize, + 0, fontInfo.spaceWidth, + fontInfo.middotWidth, options.get(EditorOption.stopRenderingLineAfter), options.get(EditorOption.renderWhitespace), options.get(EditorOption.renderControlCharacters), diff --git a/src/vs/editor/browser/widget/inlineDiffMargin.ts b/src/vs/editor/browser/widget/inlineDiffMargin.ts index 90bb8d9165a..9e61bc0b05e 100644 --- a/src/vs/editor/browser/widget/inlineDiffMargin.ts +++ b/src/vs/editor/browser/widget/inlineDiffMargin.ts @@ -9,7 +9,7 @@ import { Action } from 'vs/base/common/actions'; import { Disposable } from 'vs/base/common/lifecycle'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; +import { IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { Range } from 'vs/editor/common/core/range'; import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; @@ -57,7 +57,7 @@ export class InlineDiffMargin extends Disposable { this._marginDomNode.style.zIndex = '10'; this._diffActions = document.createElement('div'); - this._diffActions.className = 'lightbulb-glyph'; + this._diffActions.className = 'codicon codicon-lightbulb lightbulb-glyph'; this._diffActions.style.position = 'absolute'; const lineHeight = editor.getOption(EditorOption.lineHeight); const lineFeed = editor.getModel()!.getEOL(); @@ -150,8 +150,8 @@ export class InlineDiffMargin extends Disposable { })); - this._register(editor.onMouseMove((e: editorBrowser.IEditorMouseEvent) => { - if (e.target.type === editorBrowser.MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === editorBrowser.MouseTargetType.GUTTER_VIEW_ZONE) { + this._register(editor.onMouseMove((e: IEditorMouseEvent) => { + if (e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) { const viewZoneId = e.target.detail.viewZoneId; if (viewZoneId === this._viewZoneId) { @@ -165,12 +165,12 @@ export class InlineDiffMargin extends Disposable { } })); - this._register(editor.onMouseDown((e: editorBrowser.IEditorMouseEvent) => { + this._register(editor.onMouseDown((e: IEditorMouseEvent) => { if (!e.event.rightButton) { return; } - if (e.target.type === editorBrowser.MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === editorBrowser.MouseTargetType.GUTTER_VIEW_ZONE) { + if (e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) { const viewZoneId = e.target.detail.viewZoneId; if (viewZoneId === this._viewZoneId) { diff --git a/src/vs/editor/browser/widget/media/addition-dark.svg b/src/vs/editor/browser/widget/media/addition-dark.svg deleted file mode 100644 index 4d9389336b9..00000000000 --- a/src/vs/editor/browser/widget/media/addition-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/browser/widget/media/addition-light.svg b/src/vs/editor/browser/widget/media/addition-light.svg deleted file mode 100644 index 01a9de7d5ab..00000000000 --- a/src/vs/editor/browser/widget/media/addition-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/browser/widget/media/close-dark.svg b/src/vs/editor/browser/widget/media/close-dark.svg deleted file mode 100644 index 6d16d212ae5..00000000000 --- a/src/vs/editor/browser/widget/media/close-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/browser/widget/media/close-light.svg b/src/vs/editor/browser/widget/media/close-light.svg deleted file mode 100644 index 742fcae4ae7..00000000000 --- a/src/vs/editor/browser/widget/media/close-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/browser/widget/media/deletion-dark.svg b/src/vs/editor/browser/widget/media/deletion-dark.svg deleted file mode 100644 index 4c5a9c1e3a5..00000000000 --- a/src/vs/editor/browser/widget/media/deletion-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/browser/widget/media/deletion-light.svg b/src/vs/editor/browser/widget/media/deletion-light.svg deleted file mode 100644 index d12a8ee3135..00000000000 --- a/src/vs/editor/browser/widget/media/deletion-light.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/browser/widget/media/diffEditor.css b/src/vs/editor/browser/widget/media/diffEditor.css index d1d0e48f366..317916a1078 100644 --- a/src/vs/editor/browser/widget/media/diffEditor.css +++ b/src/vs/editor/browser/widget/media/diffEditor.css @@ -37,11 +37,10 @@ .monaco-diff-editor .insert-sign, .monaco-editor .delete-sign, .monaco-diff-editor .delete-sign { - background-size: 60%; - opacity: 0.7; - background-repeat: no-repeat; - background-position: 75% center; - background-size: 11px 11px; + font-size: 11px !important; + opacity: 0.7 !important; + display: flex !important; + align-items: center; } .monaco-editor.hc-black .insert-sign, .monaco-diff-editor.hc-black .insert-sign, @@ -49,27 +48,6 @@ .monaco-diff-editor.hc-black .delete-sign { opacity: 1; } -.monaco-editor .insert-sign, -.monaco-diff-editor .insert-sign { - background-image: url('addition-light.svg'); -} -.monaco-editor .delete-sign, -.monaco-diff-editor .delete-sign { - background-image: url('deletion-light.svg'); -} - -.monaco-editor.vs-dark .insert-sign, -.monaco-diff-editor.vs-dark .insert-sign, -.monaco-editor.hc-black .insert-sign, -.monaco-diff-editor.hc-black .insert-sign { - background-image: url('addition-dark.svg'); -} -.monaco-editor.vs-dark .delete-sign, -.monaco-diff-editor.vs-dark .delete-sign, -.monaco-editor.hc-black .delete-sign, -.monaco-diff-editor.hc-black .delete-sign { - background-image: url('deletion-dark.svg'); -} .monaco-editor .inline-deleted-margin-view-zone { text-align: right; @@ -94,15 +72,6 @@ display: inline-block; } -.monaco-editor .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph { - background: url('lightbulb-light.svg') center center no-repeat; -} - -.monaco-editor.vs-dark .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph, -.monaco-editor.hc-dark .margin-view-zones .inline-deleted-margin-view-zone .lightbulb-glyph { - background: url('lightbulb-dark.svg') center center no-repeat; -} - .monaco-editor .margin-view-zones .lightbulb-glyph:hover { cursor: pointer; } diff --git a/src/vs/editor/browser/widget/media/diffReview.css b/src/vs/editor/browser/widget/media/diffReview.css index f8db5bb1c67..b2b17028489 100644 --- a/src/vs/editor/browser/widget/media/diffReview.css +++ b/src/vs/editor/browser/widget/media/diffReview.css @@ -58,10 +58,3 @@ height: 16px; margin: 2px 0; } -.monaco-diff-editor .action-label.icon.close-diff-review { - background: url('close-light.svg') center center no-repeat; -} -.monaco-diff-editor.hc-black .action-label.icon.close-diff-review, -.monaco-diff-editor.vs-dark .action-label.icon.close-diff-review { - background: url('close-dark.svg') center center no-repeat; -} diff --git a/src/vs/editor/browser/widget/media/lightbulb-dark.svg b/src/vs/editor/browser/widget/media/lightbulb-dark.svg deleted file mode 100644 index 5fe8931a815..00000000000 --- a/src/vs/editor/browser/widget/media/lightbulb-dark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/vs/editor/browser/widget/media/lightbulb-light.svg b/src/vs/editor/browser/widget/media/lightbulb-light.svg deleted file mode 100644 index 191c566fd2c..00000000000 --- a/src/vs/editor/browser/widget/media/lightbulb-light.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/vs/editor/common/commands/replaceCommand.ts b/src/vs/editor/common/commands/replaceCommand.ts index 4ae44cf28c1..3e628f2db76 100644 --- a/src/vs/editor/common/commands/replaceCommand.ts +++ b/src/vs/editor/common/commands/replaceCommand.ts @@ -122,17 +122,19 @@ export class ReplaceCommandThatPreservesSelection implements ICommand { private readonly _range: Range; private readonly _text: string; private readonly _initialSelection: Selection; + private readonly _forceMoveMarkers: boolean; private _selectionId: string | null; - constructor(editRange: Range, text: string, initialSelection: Selection) { + constructor(editRange: Range, text: string, initialSelection: Selection, forceMoveMarkers: boolean = false) { this._range = editRange; this._text = text; this._initialSelection = initialSelection; + this._forceMoveMarkers = forceMoveMarkers; this._selectionId = null; } public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { - builder.addEditOperation(this._range, this._text); + builder.addTrackedEditOperation(this._range, this._text, this._forceMoveMarkers); this._selectionId = builder.trackSelection(this._initialSelection); } diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index cee6665029f..7a4bc82f8f1 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -11,7 +11,7 @@ import * as arrays from 'vs/base/common/arrays'; import { IEditorOptions, editorOptionsRegistry, ValidatedEditorOptions, IEnvironmentalOptions, IComputedEditorOptions, ConfigurationChangedEvent, EDITOR_MODEL_DEFAULTS, EditorOption, FindComputedEditorOptionValueById } from 'vs/editor/common/config/editorOptions'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; import { BareFontInfo, FontInfo } from 'vs/editor/common/config/fontInfo'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IConfiguration, IDimension } from 'vs/editor/common/editorCommon'; import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationRegistry, IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; @@ -278,7 +278,7 @@ function deepCloneAndMigrateOptions(_options: IEditorOptions): IEditorOptions { return options; } -export abstract class CommonEditorConfiguration extends Disposable implements editorCommon.IConfiguration { +export abstract class CommonEditorConfiguration extends Disposable implements IConfiguration { private _onDidChange = this._register(new Emitter()); public readonly onDidChange: Event = this._onDidChange.event; @@ -308,7 +308,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions())); } - public observeReferenceElement(dimension?: editorCommon.IDimension): void { + public observeReferenceElement(dimension?: IDimension): void { } public dispose(): void { @@ -432,7 +432,7 @@ export const editorConfigurationBaseNode = Object.freeze({ order: 5, type: 'object', title: nls.localize('editorConfigurationTitle', "Editor"), - scope: ConfigurationScope.RESOURCE_LANGUAGE, + scope: ConfigurationScope.LANGUAGE_OVERRIDABLE, }); const configurationRegistry = Registry.as(Extensions.Configuration); diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 3adac8cf46b..93c7b9bcef4 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -33,7 +33,6 @@ export type EditorAutoClosingOvertypeStrategy = 'always' | 'auto' | 'never'; /** * Configuration options for auto indentation in the editor - * @internal */ export const enum EditorAutoIndentStrategy { None = 0, @@ -136,6 +135,11 @@ export interface IEditorOptions { * Defaults to false. */ readOnly?: boolean; + /** + * Should the editor render validation decorations. + * Defaults to editable. + */ + renderValidationDecorations?: 'editable' | 'on' | 'off'; /** * Control the behavior and rendering of the scrollbars. */ @@ -262,21 +266,21 @@ export interface IEditorOptions { * Defaults to 'same' in vscode and to 'none' in monaco-editor. */ wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent'; + /** + * Controls the wrapping algorithm to use. + * Defaults to 'monospace'. + */ + wrappingAlgorithm?: 'monospace' | 'dom'; /** * Configure word wrapping characters. A break will be introduced before these characters. - * Defaults to '{([+'. + * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'. */ wordWrapBreakBeforeCharacters?: string; /** * Configure word wrapping characters. A break will be introduced after these characters. - * Defaults to ' \t})]?|&,;'. + * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'. */ wordWrapBreakAfterCharacters?: string; - /** - * Configure word wrapping characters. A break will be introduced after these characters only if no `wordWrapBreakBeforeCharacters` or `wordWrapBreakAfterCharacters` were found. - * Defaults to '.'. - */ - wordWrapBreakObtrusiveCharacters?: string; /** * Performance guard: Stop rendering a line after x characters. * Defaults to 10000. @@ -296,6 +300,10 @@ export interface IEditorOptions { * Enable inline color decorators and color picker rendering. */ colorDecorators?: boolean; + /** + * Control the behaviour of comments in the editor. + */ + comments?: IEditorCommentsOptions; /** * Enable custom contextmenu. * Defaults to true. @@ -542,6 +550,11 @@ export interface IEditorOptions { * Controls fading out of unused variables. */ showUnused?: boolean; + /** + * Controls whether to focus the inline editor in the peek widget by default. + * Defaults to false. + */ + peekWidgetDefaultFocus?: 'tree' | 'editor'; } export interface IEditorConstructionOptions extends IEditorOptions { @@ -631,7 +644,7 @@ export class ValidatedEditorOptions { } /** - * @internal + * All computed editor options. */ export interface IComputedEditorOptions { get(id: T): FindComputedEditorOptionValueById; @@ -655,9 +668,6 @@ export interface IEnvironmentalOptions { readonly accessibilitySupport: AccessibilitySupport; } -/** - * @internal - */ export interface IEditorOption { readonly id: K1; readonly name: string; @@ -991,11 +1001,56 @@ class EditorAccessibilitySupport extends BaseEditorOption>; + +class EditorComments extends BaseEditorOption { + + constructor() { + const defaults: EditorCommentsOptions = { + insertSpace: true, + }; + super( + EditorOption.comments, 'comments', defaults, + { + 'editor.comments.insertSpace': { + type: 'boolean', + default: defaults.insertSpace, + description: nls.localize('comments.insertSpace', "Controls whether a space character is inserted when commenting.") + }, + } + ); + } + + public validate(_input: any): EditorCommentsOptions { + if (typeof _input !== 'object') { + return this.defaultValue; + } + const input = _input as IEditorCommentsOptions; + return { + insertSpace: EditorBooleanOption.boolean(input.insertSpace, this.defaultValue.insertSpace), + }; + } +} + +//#endregion + //#region cursorBlinking /** * The kind of animation in which the editor's cursor should be rendered. - * @internal */ export const enum TextEditorCursorBlinkingStyle { /** @@ -1040,7 +1095,6 @@ function _cursorBlinkingStyleFromString(cursorBlinkingStyle: 'blink' | 'smooth' /** * The style in which the editor's cursor should be rendered. - * @internal */ export enum TextEditorCursorStyle { /** @@ -1169,9 +1223,6 @@ export interface IEditorFindOptions { globalFindClipboard?: boolean; } -/** - * @internal - */ export type EditorFindOptions = Readonly>; class EditorFind extends BaseEditorOption { @@ -1359,9 +1410,6 @@ export interface IGotoLocationOptions { alternativeReferenceCommand?: string; } -/** - * @internal - */ export type GoToLocationOptions = Readonly>; class EditorGoToLocation extends BaseEditorOption { @@ -1491,9 +1539,6 @@ export interface IEditorHoverOptions { sticky?: boolean; } -/** - * @internal - */ export type EditorHoverOptions = Readonly>; class EditorHover extends BaseEditorOption { @@ -1541,6 +1586,55 @@ class EditorHover extends BaseEditorOption>; + +class EditorSemanticHighlighting extends BaseEditorOption { + + constructor() { + const defaults: EditorSemanticHighlightingOptions = { + enabled: true + }; + super( + EditorOption.semanticHighlighting, 'semanticHighlighting', defaults, + { + 'editor.semanticHighlighting.enabled': { + type: 'boolean', + default: defaults.enabled, + description: nls.localize('semanticHighlighting.enabled', "Controls whether the semanticHighlighting is shown for the languages that support it.") + } + } + ); + } + + public validate(_input: any): EditorSemanticHighlightingOptions { + if (typeof _input !== 'object') { + return this.defaultValue; + } + const input = _input as IEditorSemanticHighlightingOptions; + return { + enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled) + }; + } +} + +//#endregion + //#region layoutInfo /** @@ -1593,10 +1687,6 @@ export interface EditorLayoutInfo { * The width of the glyph margin. */ readonly glyphMarginWidth: number; - /** - * The height of the glyph margin. - */ - readonly glyphMarginHeight: number; /** * Left position for the line numbers. @@ -1606,10 +1696,6 @@ export interface EditorLayoutInfo { * The width of the line numbers. */ readonly lineNumbersWidth: number; - /** - * The height of the line numbers. - */ - readonly lineNumbersHeight: number; /** * Left position for the line decorations. @@ -1619,10 +1705,6 @@ export interface EditorLayoutInfo { * The width of the line decorations. */ readonly decorationsWidth: number; - /** - * The height of the line decorations. - */ - readonly decorationsHeight: number; /** * Left position for the content (actual text) @@ -1632,10 +1714,6 @@ export interface EditorLayoutInfo { * The width of the content (actual text) */ readonly contentWidth: number; - /** - * The height of the content (actual height) - */ - readonly contentHeight: number; /** * The position for the minimap @@ -1822,19 +1900,15 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption>; class EditorLightbulb extends BaseEditorOption { @@ -1964,9 +2035,6 @@ export interface IEditorMinimapOptions { scale?: number; } -/** - * @internal - */ export type EditorMinimapOptions = Readonly>; class EditorMinimap extends BaseEditorOption { @@ -2068,9 +2136,6 @@ export interface IEditorParameterHintOptions { cycle?: boolean; } -/** - * @internal - */ export type InternalParameterHintOptions = Readonly>; class EditorParameterHints extends BaseEditorOption { @@ -2137,9 +2202,6 @@ export interface IQuickSuggestionsOptions { strings: boolean; } -/** - * @internal - */ export type ValidQuickSuggestionsOptions = boolean | Readonly>; class EditorQuickSuggestions extends BaseEditorOption { @@ -2216,9 +2278,6 @@ class EditorQuickSuggestions extends BaseEditorOption string); -/** - * @internal - */ export const enum RenderLineNumbersType { Off = 0, On = 1, @@ -2227,9 +2286,6 @@ export const enum RenderLineNumbersType { Custom = 4 } -/** - * @internal - */ export interface InternalEditorRenderLineNumbersOptions { readonly renderType: RenderLineNumbersType; readonly renderFn: ((lineNumber: number) => string) | null; @@ -2283,6 +2339,21 @@ class EditorRenderLineNumbersOption extends BaseEditorOption { @@ -2385,9 +2456,6 @@ export interface IEditorScrollbarOptions { horizontalSliderSize?: number; } -/** - * @internal - */ export interface InternalEditorScrollbarOptions { readonly arrowSize: number; readonly vertical: ScrollbarVisibility; @@ -2600,11 +2668,12 @@ export interface ISuggestOptions { * Show snippet-suggestions. */ showSnippets?: boolean; + /** + * Controls the visibility of the status bar at the bottom of the suggest widget. + */ + hideStatusBar?: boolean; } -/** - * @internal - */ export type InternalSuggestOptions = Readonly>; class EditorSuggest extends BaseEditorOption { @@ -2644,6 +2713,7 @@ class EditorSuggest extends BaseEditorOption(option: IEditorOption): IEd return option; } -/** - * @internal - */ export const enum EditorOption { acceptSuggestionOnCommitCharacter, acceptSuggestionOnEnter, @@ -3070,6 +3139,7 @@ export const enum EditorOption { autoSurround, codeLens, colorDecorators, + comments, contextmenu, copyWithSyntaxHighlighting, cursorBlinking, @@ -3121,6 +3191,7 @@ export const enum EditorOption { overviewRulerBorder, overviewRulerLanes, parameterHints, + peekWidgetDefaultFocus, quickSuggestions, quickSuggestionsDelay, readOnly, @@ -3128,6 +3199,7 @@ export const enum EditorOption { renderIndentGuides, renderFinalNewline, renderLineHighlight, + renderValidationDecorations, renderWhitespace, revealHorizontalRightPadding, roundedSelection, @@ -3138,6 +3210,7 @@ export const enum EditorOption { selectionClipboard, selectionHighlight, selectOnLineNumbers, + semanticHighlighting, showFoldingControls, showUnused, snippetSuggestions, @@ -3154,10 +3227,10 @@ export const enum EditorOption { wordWrap, wordWrapBreakAfterCharacters, wordWrapBreakBeforeCharacters, - wordWrapBreakObtrusiveCharacters, wordWrapColumn, wordWrapMinified, wrappingIndent, + wrappingAlgorithm, // Leave these at the end (because they have dependencies!) editorClassName, @@ -3168,7 +3241,19 @@ export const enum EditorOption { } /** - * @internal + * WORKAROUND: TS emits "any" for complex editor options values (anything except string, bool, enum, etc. ends up being "any") + * @monacodtsreplace + * /accessibilitySupport, any/accessibilitySupport, AccessibilitySupport/ + * /comments, any/comments, EditorCommentsOptions/ + * /find, any/find, EditorFindOptions/ + * /fontInfo, any/fontInfo, FontInfo/ + * /gotoLocation, any/gotoLocation, GoToLocationOptions/ + * /hover, any/hover, EditorHoverOptions/ + * /lightbulb, any/lightbulb, EditorLightbulbOptions/ + * /minimap, any/minimap, EditorMinimapOptions/ + * /parameterHints, any/parameterHints, InternalParameterHintOptions/ + * /quickSuggestions, any/quickSuggestions, ValidQuickSuggestionsOptions/ + * /suggest, any/suggest, InternalSuggestOptions/ */ export const EditorOptions = { acceptSuggestionOnCommitCharacter: register(new EditorBooleanOption( @@ -3276,6 +3361,7 @@ export const EditorOptions = { EditorOption.colorDecorators, 'colorDecorators', true, { description: nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.") } )), + comments: register(new EditorComments()), contextmenu: register(new EditorBooleanOption( EditorOption.contextmenu, 'contextmenu', true, )), @@ -3485,6 +3571,18 @@ export const EditorOptions = { 3, 0, 3 )), parameterHints: register(new EditorParameterHints()), + peekWidgetDefaultFocus: register(new EditorStringEnumOption( + EditorOption.peekWidgetDefaultFocus, 'peekWidgetDefaultFocus', + 'tree' as 'tree' | 'editor', + ['tree', 'editor'] as const, + { + enumDescriptions: [ + nls.localize('peekWidgetDefaultFocus.tree', "Focus the tree when openeing peek"), + nls.localize('peekWidgetDefaultFocus.editor', "Focus the editor when opening peek") + ], + description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.") + } + )), quickSuggestions: register(new EditorQuickSuggestions()), quickSuggestionsDelay: register(new EditorIntOption( EditorOption.quickSuggestionsDelay, 'quickSuggestionsDelay', @@ -3520,6 +3618,11 @@ export const EditorOptions = { description: nls.localize('renderLineHighlight', "Controls how the editor should render the current line highlight.") } )), + renderValidationDecorations: register(new EditorStringEnumOption( + EditorOption.renderValidationDecorations, 'renderValidationDecorations', + 'editable' as 'editable' | 'on' | 'off', + ['editable', 'on', 'off'] as const + )), renderWhitespace: register(new EditorStringEnumOption( EditorOption.renderWhitespace, 'renderWhitespace', 'none' as 'none' | 'boundary' | 'selection' | 'all', @@ -3567,6 +3670,7 @@ export const EditorOptions = { selectOnLineNumbers: register(new EditorBooleanOption( EditorOption.selectOnLineNumbers, 'selectOnLineNumbers', true, )), + semanticHighlighting: register(new EditorSemanticHighlighting()), showFoldingControls: register(new EditorStringEnumOption( EditorOption.showFoldingControls, 'showFoldingControls', 'mouseover' as 'always' | 'mouseover', @@ -3681,16 +3785,12 @@ export const EditorOptions = { )), wordWrapBreakAfterCharacters: register(new EditorStringOption( EditorOption.wordWrapBreakAfterCharacters, 'wordWrapBreakAfterCharacters', - ' \t})]?|/&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」', + ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」', )), wordWrapBreakBeforeCharacters: register(new EditorStringOption( EditorOption.wordWrapBreakBeforeCharacters, 'wordWrapBreakBeforeCharacters', '([{‘“〈《「『【〔([{「£¥$£¥++' )), - wordWrapBreakObtrusiveCharacters: register(new EditorStringOption( - EditorOption.wordWrapBreakObtrusiveCharacters, 'wordWrapBreakObtrusiveCharacters', - '.' - )), wordWrapColumn: register(new EditorIntOption( EditorOption.wordWrapColumn, 'wordWrapColumn', 80, 1, Constants.MAX_SAFE_SMALL_INTEGER, @@ -3722,28 +3822,28 @@ export const EditorOptions = { description: nls.localize('wrappingIndent', "Controls the indentation of wrapped lines."), } )), + wrappingAlgorithm: register(new EditorStringEnumOption( + EditorOption.wrappingAlgorithm, 'wrappingAlgorithm', + 'monospace' as 'monospace' | 'dom', + ['monospace', 'dom'] as const, + { + enumDescriptions: [ + nls.localize('wrappingAlgorithm.monospace', "Assumes that all characters are of the same width. This is a fast algorithm."), + nls.localize('wrappingAlgorithm.dom', "Delegates wrapping points computation to the DOM. This is a slow algorithm, that might cause freezes for large files.") + ], + description: nls.localize('wrappingAlgorithm', "Controls the algorithm that computes wrapping points.") + } + )), // Leave these at the end (because they have dependencies!) editorClassName: register(new EditorClassName()), pixelRatio: register(new EditorPixelRatio()), tabFocusMode: register(new EditorTabFocusMode()), layoutInfo: register(new EditorLayoutInfoComputer()), - wrappingInfo: register(new EditorWrappingInfoComputer()), + wrappingInfo: register(new EditorWrappingInfoComputer()) }; -/** - * @internal - */ type EditorOptionsType = typeof EditorOptions; -/** - * @internal - */ type FindEditorOptionsKeyById = { [K in keyof EditorOptionsType]: EditorOptionsType[K]['id'] extends T ? K : never }[keyof EditorOptionsType]; -/** - * @internal - */ type ComputedEditorOptionValue> = T extends IEditorOption ? R : never; -/** - * @internal - */ export type FindComputedEditorOptionValueById = NonNullable]>>; diff --git a/src/vs/editor/common/config/fontInfo.ts b/src/vs/editor/common/config/fontInfo.ts index 16719602fa1..1e393d5d10f 100644 --- a/src/vs/editor/common/config/fontInfo.ts +++ b/src/vs/editor/common/config/fontInfo.ts @@ -134,6 +134,7 @@ export class FontInfo extends BareFontInfo { readonly typicalFullwidthCharacterWidth: number; readonly canUseHalfwidthRightwardsArrow: boolean; readonly spaceWidth: number; + readonly middotWidth: number; readonly maxDigitWidth: number; /** @@ -152,6 +153,7 @@ export class FontInfo extends BareFontInfo { typicalFullwidthCharacterWidth: number; canUseHalfwidthRightwardsArrow: boolean; spaceWidth: number; + middotWidth: number; maxDigitWidth: number; }, isTrusted: boolean) { super(opts); @@ -161,6 +163,7 @@ export class FontInfo extends BareFontInfo { this.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth; this.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow; this.spaceWidth = opts.spaceWidth; + this.middotWidth = opts.middotWidth; this.maxDigitWidth = opts.maxDigitWidth; } @@ -179,6 +182,7 @@ export class FontInfo extends BareFontInfo { && this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow && this.spaceWidth === other.spaceWidth + && this.middotWidth === other.middotWidth && this.maxDigitWidth === other.maxDigitWidth ); } diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts index 80e20c21d7f..2b4be5b293c 100644 --- a/src/vs/editor/common/controller/cursor.ts +++ b/src/vs/editor/common/controller/cursor.ts @@ -545,7 +545,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors { // Let the view get the event first. try { const eventsCollector = this._beginEmit(); - eventsCollector.emit(new viewEvents.ViewCursorStateChangedEvent(viewSelections)); + eventsCollector.emit(new viewEvents.ViewCursorStateChangedEvent(viewSelections, selections)); } finally { this._endEmit(); } @@ -727,7 +727,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors { case H.Paste: cursorChangeReason = CursorChangeReason.Paste; - this._paste(payload.text, payload.pasteOnNewLine, payload.multicursorText); + this._paste(payload.text, payload.pasteOnNewLine, payload.multicursorText || []); break; case H.Cut: @@ -1000,7 +1000,7 @@ class CommandExecutor { let operations: IIdentifiedSingleEditOperation[] = []; let operationMinor = 0; - const addEditOperation = (selection: Range, text: string | null) => { + const addEditOperation = (selection: Range, text: string | null, forceMoveMarkers: boolean = false) => { if (selection.isEmpty() && text === '') { // This command wants to add a no-op => no thank you return; @@ -1012,15 +1012,15 @@ class CommandExecutor { }, range: selection, text: text, - forceMoveMarkers: false, + forceMoveMarkers: forceMoveMarkers, isAutoWhitespaceEdit: command.insertsAutoWhitespace }); }; let hadTrackedEditOperation = false; - const addTrackedEditOperation = (selection: Range, text: string | null) => { + const addTrackedEditOperation = (selection: Range, text: string | null, forceMoveMarkers?: boolean) => { hadTrackedEditOperation = true; - addEditOperation(selection, text); + addEditOperation(selection, text, forceMoveMarkers); }; const trackSelection = (selection: Selection, trackPreviousOnEmpty?: boolean) => { diff --git a/src/vs/editor/common/controller/cursorTypeOperations.ts b/src/vs/editor/common/controller/cursorTypeOperations.ts index d9ef5f66191..64db6112da9 100644 --- a/src/vs/editor/common/controller/cursorTypeOperations.ts +++ b/src/vs/editor/common/controller/cursorTypeOperations.ts @@ -94,7 +94,7 @@ export class TypeOperations { if (pasteOnNewLine) { // Paste entire line at the beginning of line let typeSelection = new Range(position.lineNumber, 1, position.lineNumber, 1); - commands[i] = new ReplaceCommandThatPreservesSelection(typeSelection, text, selection); + commands[i] = new ReplaceCommandThatPreservesSelection(typeSelection, text, selection, true); } else { commands[i] = new ReplaceCommand(selection, text); } @@ -492,15 +492,20 @@ export class TypeOperations { }); } + private static _autoClosingPairIsSymmetric(autoClosingPair: StandardAutoClosingPairConditional): boolean { + const { open, close } = autoClosingPair; + return (open.indexOf(close) >= 0 || close.indexOf(open) >= 0); + } + private static _isBeforeClosingBrace(config: CursorConfiguration, autoClosingPair: StandardAutoClosingPairConditional, characterAfter: string) { const otherAutoClosingPairs = config.autoClosingPairsClose2.get(characterAfter); if (!otherAutoClosingPairs) { return false; } - const thisBraceIsSymmetric = (autoClosingPair.open === autoClosingPair.close); + const thisBraceIsSymmetric = TypeOperations._autoClosingPairIsSymmetric(autoClosingPair); for (const otherAutoClosingPair of otherAutoClosingPairs) { - const otherBraceIsSymmetric = (otherAutoClosingPair.open === otherAutoClosingPair.close); + const otherBraceIsSymmetric = TypeOperations._autoClosingPairIsSymmetric(otherAutoClosingPair); if (!thisBraceIsSymmetric && otherBraceIsSymmetric) { continue; } diff --git a/src/vs/editor/common/core/characterClassifier.ts b/src/vs/editor/common/core/characterClassifier.ts index 214bb2abf05..e5aac27c816 100644 --- a/src/vs/editor/common/core/characterClassifier.ts +++ b/src/vs/editor/common/core/characterClassifier.ts @@ -12,14 +12,14 @@ export class CharacterClassifier { /** * Maintain a compact (fully initialized ASCII map for quickly classifying ASCII characters - used more often in code). */ - private _asciiMap: Uint8Array; + protected _asciiMap: Uint8Array; /** * The entire map (sparse array). */ - private _map: Map; + protected _map: Map; - private _defaultValue: number; + protected _defaultValue: number; constructor(_defaultValue: T) { let defaultValue = toUint8(_defaultValue); diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 679cb676023..ee22f3ce88c 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -22,7 +22,7 @@ export interface IEditOperationBuilder { * @param range The range to replace (delete). May be empty to represent a simple insert. * @param text The text to replace with. May be null to represent a simple delete. */ - addEditOperation(range: Range, text: string | null): void; + addEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void; /** * Add a new edit operation (a replace operation). @@ -30,7 +30,7 @@ export interface IEditOperationBuilder { * @param range The range to replace (delete). May be empty to represent a simple insert. * @param text The text to replace with. May be null to represent a simple delete. */ - addTrackedEditOperation(range: Range, text: string | null): void; + addTrackedEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void; /** * Track `selection` when applying edit operations. @@ -174,6 +174,14 @@ export interface IScrollEvent { readonly scrollHeightChanged: boolean; } +export interface IContentSizeChangedEvent { + readonly contentWidth: number; + readonly contentHeight: number; + + readonly contentWidthChanged: boolean; + readonly contentHeightChanged: boolean; +} + export interface INewScrollPosition { scrollLeft?: number; scrollTop?: number; diff --git a/src/vs/editor/common/model/indentationGuesser.ts b/src/vs/editor/common/model/indentationGuesser.ts index b1790f97bdb..396f4cbb955 100644 --- a/src/vs/editor/common/model/indentationGuesser.ts +++ b/src/vs/editor/common/model/indentationGuesser.ts @@ -72,11 +72,12 @@ function spacesDiff(a: string, aLength: number, b: string, bLength: number, resu if (spacesDiff > 0 && 0 <= bSpacesCnt - 1 && bSpacesCnt - 1 < a.length && bSpacesCnt < b.length) { if (b.charCodeAt(bSpacesCnt) !== CharCode.Space && a.charCodeAt(bSpacesCnt - 1) === CharCode.Space) { - // This looks like an alignment desire: e.g. - // const a = b + c, - // d = b - c; - - result.looksLikeAlignment = true; + if (a.charCodeAt(a.length - 1) === CharCode.Comma) { + // This looks like an alignment desire: e.g. + // const a = b + c, + // d = b - c; + result.looksLikeAlignment = true; + } } } return; diff --git a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts index 1c844dd66c4..ac23e98889c 100644 --- a/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts +++ b/src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts @@ -511,7 +511,93 @@ export class PieceTreeBase { } public getLinesContent(): string[] { - return this.getContentOfSubTree(this.root).split(/\r\n|\r|\n/); + let lines: string[] = []; + let linesLength = 0; + let currentLine = ''; + let danglingCR = false; + + this.iterate(this.root, node => { + if (node === SENTINEL) { + return true; + } + + const piece = node.piece; + let pieceLength = piece.length; + if (pieceLength === 0) { + return true; + } + + const buffer = this._buffers[piece.bufferIndex].buffer; + const lineStarts = this._buffers[piece.bufferIndex].lineStarts; + + const pieceStartLine = piece.start.line; + const pieceEndLine = piece.end.line; + let pieceStartOffset = lineStarts[pieceStartLine] + piece.start.column; + + if (danglingCR) { + if (buffer.charCodeAt(pieceStartOffset) === CharCode.LineFeed) { + // pretend the \n was in the previous piece.. + pieceStartOffset++; + pieceLength--; + } + lines[linesLength++] = currentLine; + currentLine = ''; + danglingCR = false; + if (pieceLength === 0) { + return true; + } + } + + if (pieceStartLine === pieceEndLine) { + // this piece has no new lines + if (!this._EOLNormalized && buffer.charCodeAt(pieceStartOffset + pieceLength - 1) === CharCode.CarriageReturn) { + danglingCR = true; + currentLine += buffer.substr(pieceStartOffset, pieceLength - 1); + } else { + currentLine += buffer.substr(pieceStartOffset, pieceLength); + } + return true; + } + + // add the text before the first line start in this piece + currentLine += ( + this._EOLNormalized + ? buffer.substring(pieceStartOffset, Math.max(pieceStartOffset, lineStarts[pieceStartLine + 1] - this._EOLLength)) + : buffer.substring(pieceStartOffset, lineStarts[pieceStartLine + 1]).replace(/(\r\n|\r|\n)$/, '') + ); + lines[linesLength++] = currentLine; + + for (let line = pieceStartLine + 1; line < pieceEndLine; line++) { + currentLine = ( + this._EOLNormalized + ? buffer.substring(lineStarts[line], lineStarts[line + 1] - this._EOLLength) + : buffer.substring(lineStarts[line], lineStarts[line + 1]).replace(/(\r\n|\r|\n)$/, '') + ); + lines[linesLength++] = currentLine; + } + + if (!this._EOLNormalized && buffer.charCodeAt(lineStarts[pieceEndLine] + piece.end.column - 1) === CharCode.CarriageReturn) { + danglingCR = true; + if (piece.end.column === 0) { + // The last line ended with a \r, let's undo the push, it will be pushed by next iteration + linesLength--; + } else { + currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column - 1); + } + } else { + currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column); + } + + return true; + }); + + if (danglingCR) { + lines[linesLength++] = currentLine; + currentLine = ''; + } + + lines[linesLength++] = currentLine; + return lines; } public getLength(): number { @@ -728,7 +814,7 @@ export class PieceTreeBase { // #endregion // #region Piece Table - insert(offset: number, value: string, eolNormalized: boolean = false): void { + public insert(offset: number, value: string, eolNormalized: boolean = false): void { this._EOLNormalized = this._EOLNormalized && eolNormalized; this._lastVisitedLine.lineNumber = 0; this._lastVisitedLine.value = ''; @@ -826,7 +912,7 @@ export class PieceTreeBase { this.computeBufferMetadata(); } - delete(offset: number, cnt: number): void { + public delete(offset: number, cnt: number): void { this._lastVisitedLine.lineNumber = 0; this._lastVisitedLine.value = ''; @@ -899,7 +985,7 @@ export class PieceTreeBase { this.computeBufferMetadata(); } - insertContentToNodeLeft(value: string, node: TreeNode) { + private insertContentToNodeLeft(value: string, node: TreeNode) { // we are inserting content to the beginning of node let nodesToDel: TreeNode[] = []; if (this.shouldCheckCRLF() && this.endWithCR(value) && this.startWithLF(node)) { @@ -934,7 +1020,7 @@ export class PieceTreeBase { this.deleteNodes(nodesToDel); } - insertContentToNodeRight(value: string, node: TreeNode) { + private insertContentToNodeRight(value: string, node: TreeNode) { // we are inserting to the right of this node. if (this.adjustCarriageReturnFromNext(value, node)) { // move \n to the new node. @@ -952,9 +1038,9 @@ export class PieceTreeBase { this.validateCRLFWithPrevNode(newNode); } - positionInBuffer(node: TreeNode, remainder: number): BufferCursor; - positionInBuffer(node: TreeNode, remainder: number, ret: BufferCursor): null; - positionInBuffer(node: TreeNode, remainder: number, ret?: BufferCursor): BufferCursor | null { + private positionInBuffer(node: TreeNode, remainder: number): BufferCursor; + private positionInBuffer(node: TreeNode, remainder: number, ret: BufferCursor): null; + private positionInBuffer(node: TreeNode, remainder: number, ret?: BufferCursor): BufferCursor | null { let piece = node.piece; let bufferIndex = node.piece.bufferIndex; let lineStarts = this._buffers[bufferIndex].lineStarts; @@ -1002,7 +1088,7 @@ export class PieceTreeBase { }; } - getLineFeedCnt(bufferIndex: number, start: BufferCursor, end: BufferCursor): number { + private getLineFeedCnt(bufferIndex: number, start: BufferCursor, end: BufferCursor): number { // we don't need to worry about start: abc\r|\n, or abc|\r, or abc|\n, or abc|\r\n doesn't change the fact that, there is one line break after start. // now let's take care of end: abc\r|\n, if end is in between \r and \n, we need to add line feed count by 1 if (end.column === 0) { @@ -1032,18 +1118,18 @@ export class PieceTreeBase { } } - offsetInBuffer(bufferIndex: number, cursor: BufferCursor): number { + private offsetInBuffer(bufferIndex: number, cursor: BufferCursor): number { let lineStarts = this._buffers[bufferIndex].lineStarts; return lineStarts[cursor.line] + cursor.column; } - deleteNodes(nodes: TreeNode[]): void { + private deleteNodes(nodes: TreeNode[]): void { for (let i = 0; i < nodes.length; i++) { rbDelete(this, nodes[i]); } } - createNewPieces(text: string): Piece[] { + private createNewPieces(text: string): Piece[] { if (text.length > AverageBufferSize) { // the content is large, operations like substring, charCode becomes slow // so here we split it into smaller chunks, just like what we did for CR/LF normalization @@ -1128,11 +1214,11 @@ export class PieceTreeBase { return [newPiece]; } - getLinesRawContent(): string { + public getLinesRawContent(): string { return this.getContentOfSubTree(this.root); } - getLineRawContent(lineNumber: number, endOffset: number = 0): string { + public getLineRawContent(lineNumber: number, endOffset: number = 0): string { let x = this.root; let ret = ''; @@ -1204,7 +1290,7 @@ export class PieceTreeBase { return ret; } - computeBufferMetadata() { + private computeBufferMetadata() { let x = this.root; let lfCnt = 1; @@ -1222,7 +1308,7 @@ export class PieceTreeBase { } // #region node operations - getIndexOf(node: TreeNode, accumulatedValue: number): { index: number, remainder: number } { + private getIndexOf(node: TreeNode, accumulatedValue: number): { index: number, remainder: number } { let piece = node.piece; let pos = this.positionInBuffer(node, accumulatedValue); let lineCnt = pos.line - piece.start.line; @@ -1239,7 +1325,7 @@ export class PieceTreeBase { return { index: lineCnt, remainder: pos.column }; } - getAccumulatedValue(node: TreeNode, index: number) { + private getAccumulatedValue(node: TreeNode, index: number) { if (index < 0) { return 0; } @@ -1253,7 +1339,7 @@ export class PieceTreeBase { } } - deleteNodeTail(node: TreeNode, pos: BufferCursor) { + private deleteNodeTail(node: TreeNode, pos: BufferCursor) { const piece = node.piece; const originalLFCnt = piece.lineFeedCnt; const originalEndOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); @@ -1277,7 +1363,7 @@ export class PieceTreeBase { updateTreeMetadata(this, node, size_delta, lf_delta); } - deleteNodeHead(node: TreeNode, pos: BufferCursor) { + private deleteNodeHead(node: TreeNode, pos: BufferCursor) { const piece = node.piece; const originalLFCnt = piece.lineFeedCnt; const originalStartOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); @@ -1299,7 +1385,7 @@ export class PieceTreeBase { updateTreeMetadata(this, node, size_delta, lf_delta); } - shrinkNode(node: TreeNode, start: BufferCursor, end: BufferCursor) { + private shrinkNode(node: TreeNode, start: BufferCursor, end: BufferCursor) { const piece = node.piece; const originalStartPos = piece.start; const originalEndPos = piece.end; @@ -1334,7 +1420,7 @@ export class PieceTreeBase { this.validateCRLFWithPrevNode(newNode); } - appendToNode(node: TreeNode, value: string): void { + private appendToNode(node: TreeNode, value: string): void { if (this.adjustCarriageReturnFromNext(value, node)) { value += '\n'; } @@ -1374,7 +1460,7 @@ export class PieceTreeBase { updateTreeMetadata(this, node, value.length, lf_delta); } - nodeAt(offset: number): NodePosition { + private nodeAt(offset: number): NodePosition { let x = this.root; let cache = this._searchCache.get(offset); if (cache) { @@ -1409,7 +1495,7 @@ export class PieceTreeBase { return null!; } - nodeAt2(lineNumber: number, column: number): NodePosition { + private nodeAt2(lineNumber: number, column: number): NodePosition { let x = this.root; let nodeStartOffset = 0; @@ -1476,7 +1562,7 @@ export class PieceTreeBase { return null!; } - nodeCharCodeAt(node: TreeNode, offset: number): number { + private nodeCharCodeAt(node: TreeNode, offset: number): number { if (node.piece.lineFeedCnt < 1) { return -1; } @@ -1485,7 +1571,7 @@ export class PieceTreeBase { return buffer.buffer.charCodeAt(newOffset); } - offsetOfNode(node: TreeNode): number { + private offsetOfNode(node: TreeNode): number { if (!node) { return 0; } @@ -1504,11 +1590,11 @@ export class PieceTreeBase { // #endregion // #region CRLF - shouldCheckCRLF() { + private shouldCheckCRLF() { return !(this._EOLNormalized && this._EOL === '\n'); } - startWithLF(val: string | TreeNode): boolean { + private startWithLF(val: string | TreeNode): boolean { if (typeof val === 'string') { return val.charCodeAt(0) === 10; } @@ -1532,7 +1618,7 @@ export class PieceTreeBase { return this._buffers[piece.bufferIndex].buffer.charCodeAt(startOffset) === 10; } - endWithCR(val: string | TreeNode): boolean { + private endWithCR(val: string | TreeNode): boolean { if (typeof val === 'string') { return val.charCodeAt(val.length - 1) === 13; } @@ -1544,7 +1630,7 @@ export class PieceTreeBase { return this.nodeCharCodeAt(val, val.piece.length - 1) === 13; } - validateCRLFWithPrevNode(nextNode: TreeNode) { + private validateCRLFWithPrevNode(nextNode: TreeNode) { if (this.shouldCheckCRLF() && this.startWithLF(nextNode)) { let node = nextNode.prev(); if (this.endWithCR(node)) { @@ -1553,7 +1639,7 @@ export class PieceTreeBase { } } - validateCRLFWithNextNode(node: TreeNode) { + private validateCRLFWithNextNode(node: TreeNode) { if (this.shouldCheckCRLF() && this.endWithCR(node)) { let nextNode = node.next(); if (this.startWithLF(nextNode)) { @@ -1562,7 +1648,7 @@ export class PieceTreeBase { } } - fixCRLF(prev: TreeNode, next: TreeNode) { + private fixCRLF(prev: TreeNode, next: TreeNode) { let nodesToDel: TreeNode[] = []; // update node let lineStarts = this._buffers[prev.piece.bufferIndex].lineStarts; @@ -1617,7 +1703,7 @@ export class PieceTreeBase { } } - adjustCarriageReturnFromNext(value: string, node: TreeNode): boolean { + private adjustCarriageReturnFromNext(value: string, node: TreeNode): boolean { if (this.shouldCheckCRLF() && this.endWithCR(value)) { let nextNode = node.next(); if (this.startWithLF(nextNode)) { @@ -1667,7 +1753,7 @@ export class PieceTreeBase { return callback(node) && this.iterate(node.right, callback); } - getNodeContent(node: TreeNode) { + private getNodeContent(node: TreeNode) { if (node === SENTINEL) { return ''; } @@ -1695,7 +1781,7 @@ export class PieceTreeBase { * / * z */ - rbInsertRight(node: TreeNode | null, p: Piece): TreeNode { + private rbInsertRight(node: TreeNode | null, p: Piece): TreeNode { let z = new TreeNode(p, NodeColor.Red); z.left = SENTINEL; z.right = SENTINEL; @@ -1727,7 +1813,7 @@ export class PieceTreeBase { * \ * z */ - rbInsertLeft(node: TreeNode | null, p: Piece): TreeNode { + private rbInsertLeft(node: TreeNode | null, p: Piece): TreeNode { let z = new TreeNode(p, NodeColor.Red); z.left = SENTINEL; z.right = SENTINEL; @@ -1751,7 +1837,7 @@ export class PieceTreeBase { return z; } - getContentOfSubTree(node: TreeNode): string { + private getContentOfSubTree(node: TreeNode): string { let str = ''; this.iterate(node, node => { diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 9bc6dc21a62..f154d2bc0f8 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -158,6 +158,17 @@ class TextModelSnapshot implements model.ITextSnapshot { const invalidFunc = () => { throw new Error(`Invalid change accessor`); }; +const enum StringOffsetValidationType { + /** + * Even allowed in surrogate pairs + */ + Relaxed = 0, + /** + * Not allowed in surrogate pairs + */ + SurrogatePairs = 1, +} + export class TextModel extends Disposable implements model.ITextModel { private static readonly MODEL_SYNC_LIMIT = 50 * 1024 * 1024; // 50 MB @@ -673,7 +684,7 @@ export class TextModel extends Disposable implements model.ITextModel { public getOffsetAt(rawPosition: IPosition): number { this._assertNotDisposed(); - let position = this._validatePosition(rawPosition.lineNumber, rawPosition.column, false); + let position = this._validatePosition(rawPosition.lineNumber, rawPosition.column, StringOffsetValidationType.Relaxed); return this._buffer.getOffsetAt(position.lineNumber, position.column); } @@ -868,10 +879,7 @@ export class TextModel extends Disposable implements model.ITextModel { return new Range(startLineNumber, startColumn, endLineNumber, endColumn); } - /** - * @param strict Do NOT allow a position inside a high-low surrogate pair - */ - private _isValidPosition(lineNumber: number, column: number, strict: boolean): boolean { + private _isValidPosition(lineNumber: number, column: number, validationType: StringOffsetValidationType): boolean { if (typeof lineNumber !== 'number' || typeof column !== 'number') { return false; } @@ -893,14 +901,19 @@ export class TextModel extends Disposable implements model.ITextModel { return false; } + if (column === 1) { + return true; + } + const maxColumn = this.getLineMaxColumn(lineNumber); if (column > maxColumn) { return false; } - if (strict) { - const [charStartOffset,] = strings.getCharContainingOffset(this._buffer.getLineContent(lineNumber), column - 1); - if (column !== charStartOffset + 1) { + if (validationType === StringOffsetValidationType.SurrogatePairs) { + // !!At this point, column > 1 + const charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2); + if (strings.isHighSurrogate(charCodeBefore)) { return false; } } @@ -908,10 +921,7 @@ export class TextModel extends Disposable implements model.ITextModel { return true; } - /** - * @param strict Do NOT allow a position inside a high-low surrogate pair - */ - private _validatePosition(_lineNumber: number, _column: number, strict: boolean): Position { + private _validatePosition(_lineNumber: number, _column: number, validationType: StringOffsetValidationType): Position { const lineNumber = Math.floor((typeof _lineNumber === 'number' && !isNaN(_lineNumber)) ? _lineNumber : 1); const column = Math.floor((typeof _column === 'number' && !isNaN(_column)) ? _column : 1); const lineCount = this._buffer.getLineCount(); @@ -933,10 +943,13 @@ export class TextModel extends Disposable implements model.ITextModel { return new Position(lineNumber, maxColumn); } - if (strict) { - const [charStartOffset,] = strings.getCharContainingOffset(this._buffer.getLineContent(lineNumber), column - 1); - if (column !== charStartOffset + 1) { - return new Position(lineNumber, charStartOffset + 1); + if (validationType === StringOffsetValidationType.SurrogatePairs) { + // If the position would end up in the middle of a high-low surrogate pair, + // we move it to before the pair + // !!At this point, column > 1 + const charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2); + if (strings.isHighSurrogate(charCodeBefore)) { + return new Position(lineNumber, column - 1); } } @@ -944,94 +957,95 @@ export class TextModel extends Disposable implements model.ITextModel { } public validatePosition(position: IPosition): Position { + const validationType = StringOffsetValidationType.SurrogatePairs; this._assertNotDisposed(); // Avoid object allocation and cover most likely case if (position instanceof Position) { - if (this._isValidPosition(position.lineNumber, position.column, true)) { + if (this._isValidPosition(position.lineNumber, position.column, validationType)) { return position; } } - return this._validatePosition(position.lineNumber, position.column, true); + return this._validatePosition(position.lineNumber, position.column, validationType); } - /** - * @param strict Do NOT allow a range to have its boundaries inside a high-low surrogate pair - */ - private _isValidRange(range: Range, strict: boolean): boolean { + private _isValidRange(range: Range, validationType: StringOffsetValidationType): boolean { const startLineNumber = range.startLineNumber; const startColumn = range.startColumn; const endLineNumber = range.endLineNumber; const endColumn = range.endColumn; - if (!this._isValidPosition(startLineNumber, startColumn, false)) { + if (!this._isValidPosition(startLineNumber, startColumn, StringOffsetValidationType.Relaxed)) { return false; } - if (!this._isValidPosition(endLineNumber, endColumn, false)) { + if (!this._isValidPosition(endLineNumber, endColumn, StringOffsetValidationType.Relaxed)) { return false; } - if (strict) { - const startLineContent = this._buffer.getLineContent(startLineNumber); - if (startColumn < startLineContent.length + 1) { - const [charStartOffset,] = strings.getCharContainingOffset(startLineContent, startColumn - 1); - if (startColumn !== charStartOffset + 1) { - return false; - } - } + if (validationType === StringOffsetValidationType.SurrogatePairs) { + const charCodeBeforeStart = (startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0); + const charCodeBeforeEnd = (endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0); - if (endColumn >= 2) { - const endLineContent = (endLineNumber === startLineNumber ? startLineContent : this._buffer.getLineContent(endLineNumber)); - const [, charEndOffset] = strings.getCharContainingOffset(endLineContent, endColumn - 2); - if (endColumn !== charEndOffset + 1) { - return false; - } - } + const startInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeStart); + const endInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeEnd); - return true; + if (!startInsideSurrogatePair && !endInsideSurrogatePair) { + return true; + } + return false; } return true; } public validateRange(_range: IRange): Range { + const validationType = StringOffsetValidationType.SurrogatePairs; this._assertNotDisposed(); // Avoid object allocation and cover most likely case if ((_range instanceof Range) && !(_range instanceof Selection)) { - if (this._isValidRange(_range, true)) { + if (this._isValidRange(_range, validationType)) { return _range; } } - const start = this._validatePosition(_range.startLineNumber, _range.startColumn, false); - const end = this._validatePosition(_range.endLineNumber, _range.endColumn, false); + const start = this._validatePosition(_range.startLineNumber, _range.startColumn, StringOffsetValidationType.Relaxed); + const end = this._validatePosition(_range.endLineNumber, _range.endColumn, StringOffsetValidationType.Relaxed); const startLineNumber = start.lineNumber; - let startColumn = start.column; + const startColumn = start.column; const endLineNumber = end.lineNumber; - let endColumn = end.column; - const isEmpty = (startLineNumber === endLineNumber && startColumn === endColumn); + const endColumn = end.column; - const startLineContent = this._buffer.getLineContent(startLineNumber); - if (startColumn < startLineContent.length + 1) { - const [charStartOffset,] = strings.getCharContainingOffset(startLineContent, startColumn - 1); - if (startColumn !== charStartOffset + 1) { - if (isEmpty) { - // do not expand a collapsed range, simply move it to a valid location - return new Range(startLineNumber, charStartOffset + 1, startLineNumber, charStartOffset + 1); - } - startColumn = charStartOffset + 1; - } - } + if (validationType === StringOffsetValidationType.SurrogatePairs) { + const charCodeBeforeStart = (startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0); + const charCodeBeforeEnd = (endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0); - if (endColumn >= 2) { - const endLineContent = (endLineNumber === startLineNumber ? startLineContent : this._buffer.getLineContent(endLineNumber)); - const [, charEndOffset] = strings.getCharContainingOffset(endLineContent, endColumn - 2); - if (endColumn !== charEndOffset + 1) { - endColumn = charEndOffset + 1; + const startInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeStart); + const endInsideSurrogatePair = strings.isHighSurrogate(charCodeBeforeEnd); + + if (!startInsideSurrogatePair && !endInsideSurrogatePair) { + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); } + + if (startLineNumber === endLineNumber && startColumn === endColumn) { + // do not expand a collapsed range, simply move it to a valid location + return new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn - 1); + } + + if (startInsideSurrogatePair && endInsideSurrogatePair) { + // expand range at both ends + return new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn + 1); + } + + if (startInsideSurrogatePair) { + // only expand range at the start + return new Range(startLineNumber, startColumn - 1, endLineNumber, endColumn); + } + + // only expand range at the end + return new Range(startLineNumber, startColumn, endLineNumber, endColumn + 1); } return new Range(startLineNumber, startColumn, endLineNumber, endColumn); @@ -1933,6 +1947,7 @@ export class TextModel extends Disposable implements model.ITextModel { private _matchBracket(position: Position): [Range, Range] | null { const lineNumber = position.lineNumber; const lineTokens = this._getLineTokens(lineNumber); + const tokenCount = lineTokens.getCount(); const lineText = this._buffer.getLineContent(lineNumber); const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); @@ -1945,6 +1960,15 @@ export class TextModel extends Disposable implements model.ITextModel { if (currentModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(tokenIndex))) { // limit search to not go before `maxBracketLength` let searchStartOffset = Math.max(0, position.column - 1 - currentModeBrackets.maxBracketLength); + for (let i = tokenIndex - 1; i >= 0; i--) { + const tokenEndOffset = lineTokens.getEndOffset(i); + if (tokenEndOffset <= searchStartOffset) { + break; + } + if (ignoreBracketsInToken(lineTokens.getStandardTokenType(i))) { + searchStartOffset = tokenEndOffset; + } + } // limit search to not go after `maxBracketLength` const searchEndOffset = Math.min(lineText.length, position.column - 1 + currentModeBrackets.maxBracketLength); @@ -1984,7 +2008,16 @@ export class TextModel extends Disposable implements model.ITextModel { if (prevModeBrackets && !ignoreBracketsInToken(lineTokens.getStandardTokenType(prevTokenIndex))) { // limit search in case previous token is very large, there's no need to go beyond `maxBracketLength` const searchStartOffset = Math.max(0, position.column - 1 - prevModeBrackets.maxBracketLength); - const searchEndOffset = Math.min(lineText.length, position.column - 1 + prevModeBrackets.maxBracketLength); + let searchEndOffset = Math.min(lineText.length, position.column - 1 + prevModeBrackets.maxBracketLength); + for (let i = prevTokenIndex + 1; i < tokenCount; i++) { + const tokenStartOffset = lineTokens.getStartOffset(i); + if (tokenStartOffset >= searchEndOffset) { + break; + } + if (ignoreBracketsInToken(lineTokens.getStandardTokenType(i))) { + searchEndOffset = tokenStartOffset; + } + } const foundBracket = BracketsUtils.findPrevBracketInRange(prevModeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); // check that we didn't hit a bracket too far away from position diff --git a/src/vs/editor/common/model/tokensStore.ts b/src/vs/editor/common/model/tokensStore.ts index 359c755e057..d77bb8b7de6 100644 --- a/src/vs/editor/common/model/tokensStore.ts +++ b/src/vs/editor/common/model/tokensStore.ts @@ -804,7 +804,7 @@ export class TokensStore2 { aIndex++; } - const aMetadata = aTokens.getMetadata(aIndex - 1 > 0 ? aIndex - 1 : aIndex); + const aMetadata = aTokens.getMetadata(Math.min(Math.max(0, aIndex - 1), aLen - 1)); const languageId = TokenMetadata.getLanguageId(aMetadata); const tokenType = TokenMetadata.getTokenType(aMetadata); diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index f76bd9e1f4b..960a7f35e83 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -369,6 +369,28 @@ export let completionKindFromString: { }; })(); +export interface CompletionItemLabel { + /** + * The function or variable. Rendered leftmost. + */ + name: string; + + /** + * The signature without the return type. Render after `name`. + */ + signature?: string; + + /** + * The fully qualified name, like package name or file path. Rendered after `signature`. + */ + qualifier?: string; + + /** + * The return-type of a function or type of a property/variable. Rendered rightmost. + */ + type?: string; +} + export const enum CompletionItemTag { Deprecated = 1 } @@ -396,7 +418,7 @@ export interface CompletionItem { * this is also the text that is inserted when selecting * this completion. */ - label: string; + label: string | CompletionItemLabel; /** * The kind of this completion item. Based on the kind * an icon is chosen by the editor. @@ -554,8 +576,8 @@ export interface CodeAction { /** * @internal */ -export const enum CodeActionTrigger { - Automatic = 1, +export const enum CodeActionTriggerType { + Auto = 1, Manual = 2, } @@ -564,7 +586,7 @@ export const enum CodeActionTrigger { */ export interface CodeActionContext { only?: string; - trigger: CodeActionTrigger; + trigger: CodeActionTriggerType; } export interface CodeActionList extends IDisposable { @@ -586,6 +608,11 @@ export interface CodeActionProvider { * Optional list of CodeActionKinds that this provider returns. */ providedCodeActionKinds?: ReadonlyArray; + + /** + * @internal + */ + _getAdditionalMenuItems?(context: CodeActionContext, actions: readonly CodeAction[]): Command[]; } /** @@ -1234,31 +1261,57 @@ export class FoldingRangeKind { /** * @internal */ -export function isResourceFileEdit(thing: any): thing is ResourceFileEdit { - return isObject(thing) && (Boolean((thing).newUri) || Boolean((thing).oldUri)); +export namespace WorkspaceFileEdit { + /** + * @internal + */ + export function is(thing: any): thing is WorkspaceFileEdit { + return isObject(thing) && (Boolean((thing).newUri) || Boolean((thing).oldUri)); + } } /** * @internal */ -export function isResourceTextEdit(thing: any): thing is ResourceTextEdit { - return isObject(thing) && (thing).resource && Array.isArray((thing).edits); +export namespace WorkspaceTextEdit { + /** + * @internal + */ + export function is(thing: any): thing is WorkspaceTextEdit { + return isObject(thing) && URI.isUri((thing).resource) && isObject((thing).edit); + } } -export interface ResourceFileEdit { +export interface WorkspaceEditMetadata { + needsConfirmation: boolean; + label: string; + description?: string; + iconPath?: { id: string } | { light: URI, dark: URI }; +} + +export interface WorkspaceFileEditOptions { + overwrite?: boolean; + ignoreIfNotExists?: boolean; + ignoreIfExists?: boolean; + recursive?: boolean; +} + +export interface WorkspaceFileEdit { oldUri?: URI; newUri?: URI; - options?: { overwrite?: boolean, ignoreIfNotExists?: boolean, ignoreIfExists?: boolean, recursive?: boolean }; + options?: WorkspaceFileEditOptions; + metadata?: WorkspaceEditMetadata; } -export interface ResourceTextEdit { +export interface WorkspaceTextEdit { resource: URI; + edit: TextEdit; modelVersionId?: number; - edits: TextEdit[]; + metadata?: WorkspaceEditMetadata; } export interface WorkspaceEdit { - edits: Array; + edits: Array; } export interface Rejection { @@ -1274,6 +1327,14 @@ export interface RenameProvider { resolveRenameLocation?(model: model.ITextModel, position: Position, token: CancellationToken): ProviderResult; } +/** + * @internal + */ +export interface Session { + id: string; + accessToken: string; + displayName: string; +} export interface Command { id: string; @@ -1572,10 +1633,15 @@ export interface SemanticTokensEdits { readonly edits: SemanticTokensEdit[]; } -export interface SemanticTokensProvider { +export interface DocumentSemanticTokensProvider { getLegend(): SemanticTokensLegend; - provideSemanticTokens(model: model.ITextModel, lastResultId: string | null, ranges: Range[] | null, token: CancellationToken): ProviderResult; - releaseSemanticTokens(resultId: string | undefined): void; + provideDocumentSemanticTokens(model: model.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult; + releaseDocumentSemanticTokens(resultId: string | undefined): void; +} + +export interface DocumentRangeSemanticTokensProvider { + getLegend(): SemanticTokensLegend; + provideDocumentRangeSemanticTokens(model: model.ITextModel, range: Range, token: CancellationToken): ProviderResult; } // --- feature registries ------ @@ -1683,7 +1749,12 @@ export const FoldingRangeProviderRegistry = new LanguageFeatureRegistry(); +export const DocumentSemanticTokensProviderRegistry = new LanguageFeatureRegistry(); + +/** + * @internal + */ +export const DocumentRangeSemanticTokensProviderRegistry = new LanguageFeatureRegistry(); /** * @internal diff --git a/src/vs/editor/common/modes/linkComputer.ts b/src/vs/editor/common/modes/linkComputer.ts index 9d381736536..0b70ffe5ef4 100644 --- a/src/vs/editor/common/modes/linkComputer.ts +++ b/src/vs/editor/common/modes/linkComputer.ts @@ -268,6 +268,10 @@ export class LinkComputer { // `*` terminates a link if the link began with `*` chClass = (linkBeginChCode === CharCode.Asterisk) ? CharacterClass.ForceTermination : CharacterClass.None; break; + case CharCode.Pipe: + // `|` terminates a link if the link began with `|` + chClass = (linkBeginChCode === CharCode.Pipe) ? CharacterClass.ForceTermination : CharacterClass.None; + break; default: chClass = classifier.get(chCode); } diff --git a/src/vs/editor/common/modes/supports.ts b/src/vs/editor/common/modes/supports.ts index b8cb5201ca7..f6de5f27172 100644 --- a/src/vs/editor/common/modes/supports.ts +++ b/src/vs/editor/common/modes/supports.ts @@ -62,6 +62,11 @@ export class ScopedLineTokens { return actualLineContent.substring(this.firstCharOffset, this._lastCharOffset); } + public getActualLineContentBefore(offset: number): string { + const actualLineContent = this._actual.getLineContent(); + return actualLineContent.substring(0, this.firstCharOffset + offset); + } + public getTokenCount(): number { return this._lastTokenIndex - this._firstTokenIndex; } diff --git a/src/vs/editor/common/modes/supports/electricCharacter.ts b/src/vs/editor/common/modes/supports/electricCharacter.ts index 9dee3d4ac88..ead8e6da3a6 100644 --- a/src/vs/editor/common/modes/supports/electricCharacter.ts +++ b/src/vs/editor/common/modes/supports/electricCharacter.ts @@ -49,28 +49,27 @@ export class BracketElectricCharacterSupport { return null; } - let tokenIndex = context.findTokenIndexAtOffset(column - 1); + const tokenIndex = context.findTokenIndexAtOffset(column - 1); if (ignoreBracketsInToken(context.getStandardTokenType(tokenIndex))) { return null; } - let reversedBracketRegex = this._richEditBrackets.reversedRegex; - let text = context.getLineContent().substring(0, column - 1) + character; + const reversedBracketRegex = this._richEditBrackets.reversedRegex; + const text = context.getLineContent().substring(0, column - 1) + character; - let r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, text, 0, text.length); + const r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, text, 0, text.length); if (!r) { return null; } - let bracketText = text.substring(r.startColumn - 1, r.endColumn - 1); - bracketText = bracketText.toLowerCase(); + const bracketText = text.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); - let isOpen = this._richEditBrackets.textIsOpenBracket[bracketText]; + const isOpen = this._richEditBrackets.textIsOpenBracket[bracketText]; if (isOpen) { return null; } - let textBeforeBracket = text.substring(0, r.startColumn - 1); + const textBeforeBracket = context.getActualLineContentBefore(r.startColumn - 1); if (!/^\s*$/.test(textBeforeBracket)) { // There is other text on the line before the bracket return null; diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index 4960aa3984a..3e5361ce764 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -13,7 +13,7 @@ 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 { DiffComputer } from 'vs/editor/common/diff/diffComputer'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IChange } from 'vs/editor/common/editorCommon'; import { EndOfLineSequence, IWordAtPosition } from 'vs/editor/common/model'; import { IModelChangedEvent, MirrorTextModel as BaseMirrorModel } from 'vs/editor/common/model/mirrorTextModel'; import { ensureValidWordDefinition, getWordAtText } from 'vs/editor/common/model/wordHelper'; @@ -419,7 +419,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 { let original = this._getModel(originalUrl); let modified = this._getModel(modifiedUrl); if (!original || !modified) { diff --git a/src/vs/editor/common/services/editorWorkerServiceImpl.ts b/src/vs/editor/common/services/editorWorkerServiceImpl.ts index e1e5804fdc0..1f2df5a96b7 100644 --- a/src/vs/editor/common/services/editorWorkerServiceImpl.ts +++ b/src/vs/editor/common/services/editorWorkerServiceImpl.ts @@ -10,7 +10,7 @@ import { SimpleWorkerClient, logOnceWebWorkerWarning, IWorkerClient } from 'vs/b import { DefaultWorkerFactory } from 'vs/base/worker/defaultWorkerFactory'; import { IPosition, Position } from 'vs/editor/common/core/position'; import { IRange, Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IChange } from 'vs/editor/common/editorCommon'; import { ITextModel } from 'vs/editor/common/model'; import * as modes from 'vs/editor/common/modes'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; @@ -90,7 +90,7 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker return (canSyncModel(this._modelService, original) && canSyncModel(this._modelService, modified)); } - public computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise { + public computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise { return this._workerManager.withWorker().then(client => client.computeDirtyDiff(original, modified, ignoreTrimWhitespace)); } @@ -437,7 +437,7 @@ export class EditorWorkerClient extends Disposable { }); } - public computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise { + public computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise { return this._withSyncedResources([original, modified]).then(proxy => { return proxy.computeDirtyDiff(original.toString(), modified.toString(), ignoreTrimWhitespace); }); diff --git a/src/vs/editor/common/services/markerDecorationsServiceImpl.ts b/src/vs/editor/common/services/markerDecorationsServiceImpl.ts index 44fd54c6c6d..78820460000 100644 --- a/src/vs/editor/common/services/markerDecorationsServiceImpl.ts +++ b/src/vs/editor/common/services/markerDecorationsServiceImpl.ts @@ -38,7 +38,9 @@ class MarkerDecorations extends Disposable { } public update(markers: IMarker[], newDecorations: IModelDeltaDecoration[]): void { - const ids = this.model.deltaDecorations(keys(this._markersData), newDecorations); + const oldIds = keys(this._markersData); + this._markersData.clear(); + const ids = this.model.deltaDecorations(oldIds, newDecorations); for (let index = 0; index < ids.length; index++) { this._markersData.set(ids[index], markers[index]); } @@ -145,12 +147,10 @@ export class MarkerDecorationsService extends Disposable implements IMarkerDecor let ret = Range.lift(rawMarker); - if (rawMarker.severity === MarkerSeverity.Hint) { - if (!rawMarker.tags || rawMarker.tags.indexOf(MarkerTag.Unnecessary) === -1) { - // * never render hints on multiple lines - // * make enough space for three dots - ret = ret.setEndPosition(ret.startLineNumber, ret.startColumn + 2); - } + if (rawMarker.severity === MarkerSeverity.Hint && !this._hasMarkerTag(rawMarker, MarkerTag.Unnecessary) && !this._hasMarkerTag(rawMarker, MarkerTag.Deprecated)) { + // * never render hints on multiple lines + // * make enough space for three dots + ret = ret.setEndPosition(ret.startLineNumber, ret.startColumn + 2); } ret = model.validateRange(ret); @@ -186,7 +186,7 @@ export class MarkerDecorationsService extends Disposable implements IMarkerDecor private _createDecorationOption(marker: IMarker): IModelDecorationOptions { - let className: string; + let className: string | undefined; let color: ThemeColor | undefined = undefined; let zIndex: number; let inlineClassName: string | undefined = undefined; @@ -194,7 +194,9 @@ export class MarkerDecorationsService extends Disposable implements IMarkerDecor switch (marker.severity) { case MarkerSeverity.Hint: - if (marker.tags && marker.tags.indexOf(MarkerTag.Unnecessary) >= 0) { + if (this._hasMarkerTag(marker, MarkerTag.Deprecated)) { + className = undefined; + } else if (this._hasMarkerTag(marker, MarkerTag.Unnecessary)) { className = ClassName.EditorUnnecessaryDecoration; } else { className = ClassName.EditorHintDecoration; @@ -249,4 +251,11 @@ export class MarkerDecorationsService extends Disposable implements IMarkerDecor inlineClassName, }; } + + private _hasMarkerTag(marker: IMarker, tag: MarkerTag): boolean { + if (marker.tags) { + return marker.tags.indexOf(tag) >= 0; + } + return false; + } } diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index 95b967ab215..26222549279 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -8,13 +8,13 @@ import { Disposable, IDisposable, DisposableStore } from 'vs/base/common/lifecyc import * as platform from 'vs/base/common/platform'; import * as errors from 'vs/base/common/errors'; import { URI } from 'vs/base/common/uri'; -import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions'; +import { EDITOR_MODEL_DEFAULTS, IEditorSemanticHighlightingOptions } from 'vs/editor/common/config/editorOptions'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Range } from 'vs/editor/common/core/range'; import { DefaultEndOfLine, EndOfLinePreference, EndOfLineSequence, IIdentifiedSingleEditOperation, ITextBuffer, ITextBufferFactory, ITextModel, ITextModelCreationOptions } from 'vs/editor/common/model'; import { TextModel, createTextBuffer } from 'vs/editor/common/model/textModel'; import { IModelLanguageChangedEvent, IModelContentChangedEvent } from 'vs/editor/common/model/textModelEvents'; -import { LanguageIdentifier, SemanticTokensProviderRegistry, SemanticTokensProvider, SemanticTokensLegend, SemanticTokens, SemanticTokensEdits, TokenMetadata } from 'vs/editor/common/modes'; +import { LanguageIdentifier, DocumentSemanticTokensProviderRegistry, DocumentSemanticTokensProvider, SemanticTokensLegend, SemanticTokens, SemanticTokensEdits, TokenMetadata } from 'vs/editor/common/modes'; import { PLAINTEXT_LANGUAGE_IDENTIFIER } from 'vs/editor/common/modes/modesRegistry'; import { ILanguageSelection } from 'vs/editor/common/services/modeService'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -133,7 +133,7 @@ export class ModelServiceImpl extends Disposable implements IModelService { this._configurationServiceSubscription = this._configurationService.onDidChangeConfiguration(e => this._updateModelOptions()); this._updateModelOptions(); - this._register(new SemanticColoringFeature(this, themeService, logService)); + this._register(new SemanticColoringFeature(this, themeService, configurationService, logService)); } private static _readModelOptions(config: IRawConfig, isForSimpleWidget: boolean): ITextModelCreationOptions { @@ -442,42 +442,79 @@ export interface ILineSequence { } class SemanticColoringFeature extends Disposable { + + private static readonly SETTING_ID = 'editor.semanticHighlighting'; + private _watchers: Record; private _semanticStyling: SemanticStyling; + private _configurationService: IConfigurationService; - constructor(modelService: IModelService, themeService: IThemeService, logService: ILogService) { + constructor(modelService: IModelService, themeService: IThemeService, configurationService: IConfigurationService, logService: ILogService) { super(); + this._configurationService = configurationService; this._watchers = Object.create(null); this._semanticStyling = this._register(new SemanticStyling(themeService, logService)); - this._register(modelService.onModelAdded((model) => { + + const isSemanticColoringEnabled = (model: ITextModel) => { + const options = configurationService.getValue(SemanticColoringFeature.SETTING_ID, { overrideIdentifier: model.getLanguageIdentifier().language, resource: model.uri }); + return options && options.enabled; + }; + const register = (model: ITextModel) => { this._watchers[model.uri.toString()] = new ModelSemanticColoring(model, themeService, this._semanticStyling); + }; + const deregister = (model: ITextModel, modelSemanticColoring: ModelSemanticColoring) => { + modelSemanticColoring.dispose(); + delete this._watchers[model.uri.toString()]; + }; + this._register(modelService.onModelAdded((model) => { + if (isSemanticColoringEnabled(model)) { + register(model); + } })); this._register(modelService.onModelRemoved((model) => { - this._watchers[model.uri.toString()].dispose(); - delete this._watchers[model.uri.toString()]; + const curr = this._watchers[model.uri.toString()]; + if (curr) { + deregister(model, curr); + } })); + this._configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(SemanticColoringFeature.SETTING_ID)) { + for (let model of modelService.getModels()) { + const curr = this._watchers[model.uri.toString()]; + if (isSemanticColoringEnabled(model)) { + if (!curr) { + register(model); + } + } else { + if (curr) { + deregister(model, curr); + } + } + } + } + }); } } class SemanticStyling extends Disposable { - private _caches: WeakMap; + private _caches: WeakMap; constructor( private readonly _themeService: IThemeService, private readonly _logService: ILogService ) { super(); - this._caches = new WeakMap(); + this._caches = new WeakMap(); if (this._themeService) { // workaround for tests which use undefined... :/ this._register(this._themeService.onThemeChange(() => { - this._caches = new WeakMap(); + this._caches = new WeakMap(); })); } } - public get(provider: SemanticTokensProvider): SemanticColoringProviderStyling { + public get(provider: DocumentSemanticTokensProvider): SemanticColoringProviderStyling { if (!this._caches.has(provider)) { this._caches.set(provider, new SemanticColoringProviderStyling(provider.getLegend(), this._themeService, this._logService)); } @@ -598,11 +635,12 @@ class SemanticColoringProviderStyling { } else { const tokenType = this._legend.tokenTypes[tokenTypeIndex]; const tokenModifiers: string[] = []; - for (let modifierIndex = 0; tokenModifierSet !== 0 && modifierIndex < this._legend.tokenModifiers.length; modifierIndex++) { - if (tokenModifierSet & 1) { + let modifierSet = tokenModifierSet; + for (let modifierIndex = 0; modifierSet > 0 && modifierIndex < this._legend.tokenModifiers.length; modifierIndex++) { + if (modifierSet & 1) { tokenModifiers.push(this._legend.tokenModifiers[modifierIndex]); } - tokenModifierSet = tokenModifierSet >> 1; + modifierSet = modifierSet >> 1; } metadata = this._themeService.getTheme().getTokenStyleMetadata(tokenType, tokenModifiers); @@ -638,13 +676,13 @@ const enum SemanticColoringConstants { class SemanticTokensResponse { constructor( - private readonly _provider: SemanticTokensProvider, + private readonly _provider: DocumentSemanticTokensProvider, public readonly resultId: string | undefined, public readonly data: Uint32Array ) { } public dispose(): void { - this._provider.releaseSemanticTokens(this.resultId); + this._provider.releaseDocumentSemanticTokens(this.resultId); } } @@ -672,7 +710,7 @@ class ModelSemanticColoring extends Disposable { this._fetchSemanticTokens.schedule(); } })); - this._register(SemanticTokensProviderRegistry.onDidChange(e => this._fetchSemanticTokens.schedule())); + this._register(DocumentSemanticTokensProviderRegistry.onDidChange(e => this._fetchSemanticTokens.schedule())); if (themeService) { // workaround for tests which use undefined... :/ this._register(themeService.onThemeChange(_ => { @@ -685,7 +723,6 @@ class ModelSemanticColoring extends Disposable { } public dispose(): void { - this._isDisposed = true; if (this._currentResponse) { this._currentResponse.dispose(); this._currentResponse = null; @@ -694,6 +731,9 @@ class ModelSemanticColoring extends Disposable { this._currentRequestCancellationTokenSource.cancel(); this._currentRequestCancellationTokenSource = null; } + this._setSemanticTokens(null, null, null, []); + this._isDisposed = true; + super.dispose(); } @@ -716,7 +756,7 @@ class ModelSemanticColoring extends Disposable { const styling = this._semanticStyling.get(provider); const lastResultId = this._currentResponse ? this._currentResponse.resultId || null : null; - const request = Promise.resolve(provider.provideSemanticTokens(this._model, lastResultId, null, this._currentRequestCancellationTokenSource.token)); + const request = Promise.resolve(provider.provideDocumentSemanticTokens(this._model, lastResultId, this._currentRequestCancellationTokenSource.token)); request.then((res) => { this._currentRequestCancellationTokenSource = null; @@ -744,7 +784,7 @@ class ModelSemanticColoring extends Disposable { } } - private _setSemanticTokens(provider: SemanticTokensProvider | null, tokens: SemanticTokens | SemanticTokensEdits | null, styling: SemanticColoringProviderStyling | null, pendingChanges: IModelContentChangedEvent[]): void { + private _setSemanticTokens(provider: DocumentSemanticTokensProvider | null, tokens: SemanticTokens | SemanticTokensEdits | null, styling: SemanticColoringProviderStyling | null, pendingChanges: IModelContentChangedEvent[]): void { const currentResponse = this._currentResponse; if (this._currentResponse) { this._currentResponse.dispose(); @@ -753,7 +793,7 @@ class ModelSemanticColoring extends Disposable { if (this._isDisposed) { // disposed! if (provider && tokens) { - provider.releaseSemanticTokens(tokens.resultId); + provider.releaseDocumentSemanticTokens(tokens.resultId); } return; } @@ -914,8 +954,8 @@ class ModelSemanticColoring extends Disposable { this._model.setSemanticTokens(null); } - private _getSemanticColoringProvider(): SemanticTokensProvider | null { - const result = SemanticTokensProviderRegistry.ordered(this._model); + private _getSemanticColoringProvider(): DocumentSemanticTokensProvider | null { + const result = DocumentSemanticTokensProviderRegistry.ordered(this._model); return (result.length > 0 ? result[0] : null); } } diff --git a/src/vs/editor/common/services/resolverService.ts b/src/vs/editor/common/services/resolverService.ts index 77719683a23..236bc5ef3ff 100644 --- a/src/vs/editor/common/services/resolverService.ts +++ b/src/vs/editor/common/services/resolverService.ts @@ -53,9 +53,14 @@ export interface ITextEditorModel extends IEditorModel { createSnapshot(this: ITextEditorModel): ITextSnapshot | null; /** - * Signals if this model is readonly or not. + * Signals if this model is readonly or not. */ isReadonly(): boolean; + + /** + * Figure out if this model is resolved or not. + */ + isResolved(): this is IResolvedTextEditorModel; } export interface IResolvedTextEditorModel extends ITextEditorModel { diff --git a/src/vs/editor/common/standalone/standaloneEnums.ts b/src/vs/editor/common/standalone/standaloneEnums.ts index 3340dd5c045..505779e7db8 100644 --- a/src/vs/editor/common/standalone/standaloneEnums.ts +++ b/src/vs/editor/common/standalone/standaloneEnums.ts @@ -6,16 +6,331 @@ // THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. -export enum MarkerTag { - Unnecessary = 1, - Deprecated = 2 +export enum AccessibilitySupport { + /** + * This should be the browser case where it is not known if a screen reader is attached or no. + */ + Unknown = 0, + Disabled = 1, + Enabled = 2 } -export enum MarkerSeverity { - Hint = 1, - Info = 2, - Warning = 4, - Error = 8 +export enum CompletionItemInsertTextRule { + /** + * Adjust whitespace/indentation of multiline insert texts to + * match the current line indentation. + */ + KeepWhitespace = 1, + /** + * `insertText` is a snippet. + */ + InsertAsSnippet = 4 +} + +export enum CompletionItemKind { + Method = 0, + Function = 1, + Constructor = 2, + Field = 3, + Variable = 4, + Class = 5, + Struct = 6, + Interface = 7, + Module = 8, + Property = 9, + Event = 10, + Operator = 11, + Unit = 12, + Value = 13, + Constant = 14, + Enum = 15, + EnumMember = 16, + Keyword = 17, + Text = 18, + Color = 19, + File = 20, + Reference = 21, + Customcolor = 22, + Folder = 23, + TypeParameter = 24, + Snippet = 25 +} + +export enum CompletionItemTag { + Deprecated = 1 +} + +/** + * How a suggest provider was triggered. + */ +export enum CompletionTriggerKind { + Invoke = 0, + TriggerCharacter = 1, + TriggerForIncompleteCompletions = 2 +} + +/** + * A positioning preference for rendering content widgets. + */ +export enum ContentWidgetPositionPreference { + /** + * Place the content widget exactly at a position + */ + EXACT = 0, + /** + * Place the content widget above a position + */ + ABOVE = 1, + /** + * Place the content widget below a position + */ + BELOW = 2 +} + +/** + * Describes the reason the cursor has changed its position. + */ +export enum CursorChangeReason { + /** + * Unknown or not set. + */ + NotSet = 0, + /** + * A `model.setValue()` was called. + */ + ContentFlush = 1, + /** + * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers. + */ + RecoverFromMarkers = 2, + /** + * There was an explicit user gesture. + */ + Explicit = 3, + /** + * There was a Paste. + */ + Paste = 4, + /** + * There was an Undo. + */ + Undo = 5, + /** + * There was a Redo. + */ + Redo = 6 +} + +/** + * The default end of line to use when instantiating models. + */ +export enum DefaultEndOfLine { + /** + * Use line feed (\n) as the end of line character. + */ + LF = 1, + /** + * Use carriage return and line feed (\r\n) as the end of line character. + */ + CRLF = 2 +} + +/** + * A document highlight kind. + */ +export enum DocumentHighlightKind { + /** + * A textual occurrence. + */ + Text = 0, + /** + * Read-access of a symbol, like reading a variable. + */ + Read = 1, + /** + * Write-access of a symbol, like writing to a variable. + */ + Write = 2 +} + +/** + * Configuration options for auto indentation in the editor + */ +export enum EditorAutoIndentStrategy { + None = 0, + Keep = 1, + Brackets = 2, + Advanced = 3, + Full = 4 +} + +export enum EditorOption { + acceptSuggestionOnCommitCharacter = 0, + acceptSuggestionOnEnter = 1, + accessibilitySupport = 2, + accessibilityPageSize = 3, + ariaLabel = 4, + autoClosingBrackets = 5, + autoClosingOvertype = 6, + autoClosingQuotes = 7, + autoIndent = 8, + automaticLayout = 9, + autoSurround = 10, + codeLens = 11, + colorDecorators = 12, + comments = 13, + contextmenu = 14, + copyWithSyntaxHighlighting = 15, + cursorBlinking = 16, + cursorSmoothCaretAnimation = 17, + cursorStyle = 18, + cursorSurroundingLines = 19, + cursorSurroundingLinesStyle = 20, + cursorWidth = 21, + disableLayerHinting = 22, + disableMonospaceOptimizations = 23, + dragAndDrop = 24, + emptySelectionClipboard = 25, + extraEditorClassName = 26, + fastScrollSensitivity = 27, + find = 28, + fixedOverflowWidgets = 29, + folding = 30, + foldingStrategy = 31, + foldingHighlight = 32, + fontFamily = 33, + fontInfo = 34, + fontLigatures = 35, + fontSize = 36, + fontWeight = 37, + formatOnPaste = 38, + formatOnType = 39, + glyphMargin = 40, + gotoLocation = 41, + hideCursorInOverviewRuler = 42, + highlightActiveIndentGuide = 43, + hover = 44, + inDiffEditor = 45, + letterSpacing = 46, + lightbulb = 47, + lineDecorationsWidth = 48, + lineHeight = 49, + lineNumbers = 50, + lineNumbersMinChars = 51, + links = 52, + matchBrackets = 53, + minimap = 54, + mouseStyle = 55, + mouseWheelScrollSensitivity = 56, + mouseWheelZoom = 57, + multiCursorMergeOverlapping = 58, + multiCursorModifier = 59, + multiCursorPaste = 60, + occurrencesHighlight = 61, + overviewRulerBorder = 62, + overviewRulerLanes = 63, + parameterHints = 64, + peekWidgetDefaultFocus = 65, + quickSuggestions = 66, + quickSuggestionsDelay = 67, + readOnly = 68, + renderControlCharacters = 69, + renderIndentGuides = 70, + renderFinalNewline = 71, + renderLineHighlight = 72, + renderValidationDecorations = 73, + renderWhitespace = 74, + revealHorizontalRightPadding = 75, + roundedSelection = 76, + rulers = 77, + scrollbar = 78, + scrollBeyondLastColumn = 79, + scrollBeyondLastLine = 80, + selectionClipboard = 81, + selectionHighlight = 82, + selectOnLineNumbers = 83, + semanticHighlighting = 84, + showFoldingControls = 85, + showUnused = 86, + snippetSuggestions = 87, + smoothScrolling = 88, + stopRenderingLineAfter = 89, + suggest = 90, + suggestFontSize = 91, + suggestLineHeight = 92, + suggestOnTriggerCharacters = 93, + suggestSelection = 94, + tabCompletion = 95, + useTabStops = 96, + wordSeparators = 97, + wordWrap = 98, + wordWrapBreakAfterCharacters = 99, + wordWrapBreakBeforeCharacters = 100, + wordWrapColumn = 101, + wordWrapMinified = 102, + wrappingIndent = 103, + wrappingAlgorithm = 104, + editorClassName = 105, + pixelRatio = 106, + tabFocusMode = 107, + layoutInfo = 108, + wrappingInfo = 109 +} + +/** + * End of line character preference. + */ +export enum EndOfLinePreference { + /** + * Use the end of line character identified in the text buffer. + */ + TextDefined = 0, + /** + * Use line feed (\n) as the end of line character. + */ + LF = 1, + /** + * Use carriage return and line feed (\r\n) as the end of line character. + */ + CRLF = 2 +} + +/** + * End of line character preference. + */ +export enum EndOfLineSequence { + /** + * Use line feed (\n) as the end of line character. + */ + LF = 0, + /** + * Use carriage return and line feed (\r\n) as the end of line character. + */ + CRLF = 1 +} + +/** + * Describes what to do with the indentation when pressing Enter. + */ +export enum IndentAction { + /** + * Insert new line and copy the previous line's indentation. + */ + None = 0, + /** + * Insert new line and indent once (relative to the previous line's indentation). + */ + Indent = 1, + /** + * Insert two new lines: + * - the first one indented which will hold the cursor + * - the second one at the same indentation level + */ + IndentOutdent = 2, + /** + * Insert new line and outdent once (relative to the previous line's indentation). + */ + Outdent = 3 } /** @@ -199,34 +514,16 @@ export enum KeyCode { MAX_VALUE = 112 } -/** - * The direction of a selection. - */ -export enum SelectionDirection { - /** - * The selection starts above where it ends. - */ - LTR = 0, - /** - * The selection starts below where it ends. - */ - RTL = 1 +export enum MarkerSeverity { + Hint = 1, + Info = 2, + Warning = 4, + Error = 8 } -export enum ScrollbarVisibility { - Auto = 1, - Hidden = 2, - Visible = 3 -} - -/** - * Vertical Lane in the overview ruler of the editor. - */ -export enum OverviewRulerLane { - Left = 1, - Center = 2, - Right = 4, - Full = 7 +export enum MarkerTag { + Unnecessary = 1, + Deprecated = 2 } /** @@ -237,144 +534,6 @@ export enum MinimapPosition { Gutter = 2 } -/** - * End of line character preference. - */ -export enum EndOfLinePreference { - /** - * Use the end of line character identified in the text buffer. - */ - TextDefined = 0, - /** - * Use line feed (\n) as the end of line character. - */ - LF = 1, - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - CRLF = 2 -} - -/** - * The default end of line to use when instantiating models. - */ -export enum DefaultEndOfLine { - /** - * Use line feed (\n) as the end of line character. - */ - LF = 1, - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - CRLF = 2 -} - -/** - * End of line character preference. - */ -export enum EndOfLineSequence { - /** - * Use line feed (\n) as the end of line character. - */ - LF = 0, - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - CRLF = 1 -} - -/** - * Describes the behavior of decorations when typing/editing near their edges. - * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior` - */ -export enum TrackedRangeStickiness { - AlwaysGrowsWhenTypingAtEdges = 0, - NeverGrowsWhenTypingAtEdges = 1, - GrowsOnlyWhenTypingBefore = 2, - GrowsOnlyWhenTypingAfter = 3 -} - -export enum ScrollType { - Smooth = 0, - Immediate = 1 -} - -/** - * Describes the reason the cursor has changed its position. - */ -export enum CursorChangeReason { - /** - * Unknown or not set. - */ - NotSet = 0, - /** - * A `model.setValue()` was called. - */ - ContentFlush = 1, - /** - * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers. - */ - RecoverFromMarkers = 2, - /** - * There was an explicit user gesture. - */ - Explicit = 3, - /** - * There was a Paste. - */ - Paste = 4, - /** - * There was an Undo. - */ - Undo = 5, - /** - * There was a Redo. - */ - Redo = 6 -} - -export enum RenderMinimap { - None = 0, - Text = 1, - Blocks = 2 -} - -/** - * A positioning preference for rendering content widgets. - */ -export enum ContentWidgetPositionPreference { - /** - * Place the content widget exactly at a position - */ - EXACT = 0, - /** - * Place the content widget above a position - */ - ABOVE = 1, - /** - * Place the content widget below a position - */ - BELOW = 2 -} - -/** - * A positioning preference for rendering overlay widgets. - */ -export enum OverlayWidgetPositionPreference { - /** - * Position the overlay widget in the top right corner - */ - TOP_RIGHT_CORNER = 0, - /** - * Position the overlay widget in the bottom right corner - */ - BOTTOM_RIGHT_CORNER = 1, - /** - * Position the overlay widget in the top center - */ - TOP_CENTER = 2 -} - /** * Type of hit element with the mouse in the editor. */ @@ -438,81 +597,70 @@ export enum MouseTargetType { } /** - * Describes what to do with the indentation when pressing Enter. + * A positioning preference for rendering overlay widgets. */ -export enum IndentAction { +export enum OverlayWidgetPositionPreference { /** - * Insert new line and copy the previous line's indentation. + * Position the overlay widget in the top right corner */ - None = 0, + TOP_RIGHT_CORNER = 0, /** - * Insert new line and indent once (relative to the previous line's indentation). + * Position the overlay widget in the bottom right corner */ - Indent = 1, + BOTTOM_RIGHT_CORNER = 1, /** - * Insert two new lines: - * - the first one indented which will hold the cursor - * - the second one at the same indentation level + * Position the overlay widget in the top center */ - IndentOutdent = 2, - /** - * Insert new line and outdent once (relative to the previous line's indentation). - */ - Outdent = 3 -} - -export enum CompletionItemKind { - Method = 0, - Function = 1, - Constructor = 2, - Field = 3, - Variable = 4, - Class = 5, - Struct = 6, - Interface = 7, - Module = 8, - Property = 9, - Event = 10, - Operator = 11, - Unit = 12, - Value = 13, - Constant = 14, - Enum = 15, - EnumMember = 16, - Keyword = 17, - Text = 18, - Color = 19, - File = 20, - Reference = 21, - Customcolor = 22, - Folder = 23, - TypeParameter = 24, - Snippet = 25 -} - -export enum CompletionItemTag { - Deprecated = 1 -} - -export enum CompletionItemInsertTextRule { - /** - * Adjust whitespace/indentation of multiline insert texts to - * match the current line indentation. - */ - KeepWhitespace = 1, - /** - * `insertText` is a snippet. - */ - InsertAsSnippet = 4 + TOP_CENTER = 2 } /** - * How a suggest provider was triggered. + * Vertical Lane in the overview ruler of the editor. */ -export enum CompletionTriggerKind { - Invoke = 0, - TriggerCharacter = 1, - TriggerForIncompleteCompletions = 2 +export enum OverviewRulerLane { + Left = 1, + Center = 2, + Right = 4, + Full = 7 +} + +export enum RenderLineNumbersType { + Off = 0, + On = 1, + Relative = 2, + Interval = 3, + Custom = 4 +} + +export enum RenderMinimap { + None = 0, + Text = 1, + Blocks = 2 +} + +export enum ScrollType { + Smooth = 0, + Immediate = 1 +} + +export enum ScrollbarVisibility { + Auto = 1, + Hidden = 2, + Visible = 3 +} + +/** + * The direction of a selection. + */ +export enum SelectionDirection { + /** + * The selection starts above where it ends. + */ + LTR = 0, + /** + * The selection starts below where it ends. + */ + RTL = 1 } export enum SignatureHelpTriggerKind { @@ -521,24 +669,6 @@ export enum SignatureHelpTriggerKind { ContentChange = 3 } -/** - * A document highlight kind. - */ -export enum DocumentHighlightKind { - /** - * A textual occurrence. - */ - Text = 0, - /** - * Read-access of a symbol, like reading a variable. - */ - Read = 1, - /** - * Write-access of a symbol, like writing to a variable. - */ - Write = 2 -} - /** * A symbol kind. */ @@ -573,4 +703,97 @@ export enum SymbolKind { export enum SymbolTag { Deprecated = 1 +} + +/** + * The kind of animation in which the editor's cursor should be rendered. + */ +export enum TextEditorCursorBlinkingStyle { + /** + * Hidden + */ + Hidden = 0, + /** + * Blinking + */ + Blink = 1, + /** + * Blinking with smooth fading + */ + Smooth = 2, + /** + * Blinking with prolonged filled state and smooth fading + */ + Phase = 3, + /** + * Expand collapse animation on the y axis + */ + Expand = 4, + /** + * No-Blinking + */ + Solid = 5 +} + +/** + * The style in which the editor's cursor should be rendered. + */ +export enum TextEditorCursorStyle { + /** + * As a vertical line (sitting between two characters). + */ + Line = 1, + /** + * As a block (sitting on top of a character). + */ + Block = 2, + /** + * As a horizontal line (sitting under a character). + */ + Underline = 3, + /** + * As a thin vertical line (sitting between two characters). + */ + LineThin = 4, + /** + * As an outlined block (sitting on top of a character). + */ + BlockOutline = 5, + /** + * As a thin horizontal line (sitting under a character). + */ + UnderlineThin = 6 +} + +/** + * Describes the behavior of decorations when typing/editing near their edges. + * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior` + */ +export enum TrackedRangeStickiness { + AlwaysGrowsWhenTypingAtEdges = 0, + NeverGrowsWhenTypingAtEdges = 1, + GrowsOnlyWhenTypingBefore = 2, + GrowsOnlyWhenTypingAfter = 3 +} + +/** + * Describes how to indent wrapped lines. + */ +export enum WrappingIndent { + /** + * No indentation => wrapped lines begin at column 1. + */ + None = 0, + /** + * Same => wrapped lines get the same indentation as the parent. + */ + Same = 1, + /** + * Indent => wrapped lines get +1 indentation toward the parent. + */ + Indent = 2, + /** + * DeepIndent => wrapped lines get +2 indentation toward the parent. + */ + DeepIndent = 3 } \ No newline at end of file diff --git a/src/vs/editor/common/view/viewEvents.ts b/src/vs/editor/common/view/viewEvents.ts index c82cf9ac360..b72ad327c20 100644 --- a/src/vs/editor/common/view/viewEvents.ts +++ b/src/vs/editor/common/view/viewEvents.ts @@ -9,25 +9,26 @@ 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 { ScrollType } from 'vs/editor/common/editorCommon'; +import { ScrollType, IContentSizeChangedEvent } from 'vs/editor/common/editorCommon'; export const enum ViewEventType { ViewConfigurationChanged = 1, - ViewCursorStateChanged = 2, - ViewDecorationsChanged = 3, - ViewFlushed = 4, - ViewFocusChanged = 5, - ViewLineMappingChanged = 6, - ViewLinesChanged = 7, - ViewLinesDeleted = 8, - ViewLinesInserted = 9, - ViewRevealRangeRequest = 10, - ViewScrollChanged = 11, - ViewTokensChanged = 12, - ViewTokensColorsChanged = 13, - ViewZonesChanged = 14, - ViewThemeChanged = 15, - ViewLanguageConfigurationChanged = 16 + ViewContentSizeChanged = 2, + ViewCursorStateChanged = 3, + ViewDecorationsChanged = 4, + ViewFlushed = 5, + ViewFocusChanged = 6, + ViewLanguageConfigurationChanged = 7, + ViewLineMappingChanged = 8, + ViewLinesChanged = 9, + ViewLinesDeleted = 10, + ViewLinesInserted = 11, + ViewRevealRangeRequest = 12, + ViewScrollChanged = 13, + ViewThemeChanged = 14, + ViewTokensChanged = 15, + ViewTokensColorsChanged = 16, + ViewZonesChanged = 17, } export class ViewConfigurationChangedEvent { @@ -45,17 +46,35 @@ export class ViewConfigurationChangedEvent { } } +export class ViewContentSizeChangedEvent implements IContentSizeChangedEvent { + + public readonly type = ViewEventType.ViewContentSizeChanged; + + public readonly contentWidth: number; + public readonly contentHeight: number; + + public readonly contentWidthChanged: boolean; + public readonly contentHeightChanged: boolean; + + constructor(source: IContentSizeChangedEvent) { + this.contentWidth = source.contentWidth; + this.contentHeight = source.contentHeight; + + this.contentWidthChanged = source.contentWidthChanged; + this.contentHeightChanged = source.contentHeightChanged; + } +} + export class ViewCursorStateChangedEvent { public readonly type = ViewEventType.ViewCursorStateChanged; - /** - * The primary selection is always at index 0. - */ public readonly selections: Selection[]; + public readonly modelSelections: Selection[]; - constructor(selections: Selection[]) { + constructor(selections: Selection[], modelSelections: Selection[]) { this.selections = selections; + this.modelSelections = modelSelections; } } @@ -88,6 +107,11 @@ export class ViewFocusChangedEvent { } } +export class ViewLanguageConfigurationEvent { + + public readonly type = ViewEventType.ViewLanguageConfigurationChanged; +} + export class ViewLineMappingChangedEvent { public readonly type = ViewEventType.ViewLineMappingChanged; @@ -221,6 +245,11 @@ export class ViewScrollChangedEvent { } } +export class ViewThemeChangedEvent { + + public readonly type = ViewEventType.ViewThemeChanged; +} + export class ViewTokensChangedEvent { public readonly type = ViewEventType.ViewTokensChanged; @@ -241,11 +270,6 @@ export class ViewTokensChangedEvent { } } -export class ViewThemeChangedEvent { - - public readonly type = ViewEventType.ViewThemeChanged; -} - export class ViewTokensColorsChangedEvent { public readonly type = ViewEventType.ViewTokensColorsChanged; @@ -264,28 +288,24 @@ export class ViewZonesChangedEvent { } } -export class ViewLanguageConfigurationEvent { - - public readonly type = ViewEventType.ViewLanguageConfigurationChanged; -} - export type ViewEvent = ( ViewConfigurationChangedEvent + | ViewContentSizeChangedEvent | ViewCursorStateChangedEvent | ViewDecorationsChangedEvent | ViewFlushedEvent | ViewFocusChangedEvent - | ViewLinesChangedEvent + | ViewLanguageConfigurationEvent | ViewLineMappingChangedEvent + | ViewLinesChangedEvent | ViewLinesDeletedEvent | ViewLinesInsertedEvent | ViewRevealRangeRequestEvent | ViewScrollChangedEvent + | ViewThemeChangedEvent | ViewTokensChangedEvent | ViewTokensColorsChangedEvent | ViewZonesChangedEvent - | ViewThemeChangedEvent - | ViewLanguageConfigurationEvent ); export interface IViewEventListener { diff --git a/src/vs/editor/common/viewLayout/viewLayout.ts b/src/vs/editor/common/viewLayout/viewLayout.ts index 198a6794718..4b484b871ea 100644 --- a/src/vs/editor/common/viewLayout/viewLayout.ts +++ b/src/vs/editor/common/viewLayout/viewLayout.ts @@ -3,26 +3,159 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; +import { Event, Emitter } from 'vs/base/common/event'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable'; +import { IScrollPosition, ScrollEvent, Scrollable, ScrollbarVisibility, INewScrollPosition } from 'vs/base/common/scrollable'; import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IConfiguration, IContentSizeChangedEvent } from 'vs/editor/common/editorCommon'; import { LinesLayout, IEditorWhitespace, IWhitespaceChangeAccessor } from 'vs/editor/common/viewLayout/linesLayout'; import { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; import { IViewLayout, IViewWhitespaceViewportData, Viewport } from 'vs/editor/common/viewModel/viewModel'; const SMOOTH_SCROLLING_TIME = 125; -export class ViewLayout extends Disposable implements IViewLayout { +class EditorScrollDimensions { - private readonly _configuration: editorCommon.IConfiguration; - private readonly _linesLayout: LinesLayout; + public readonly width: number; + public readonly contentWidth: number; + public readonly scrollWidth: number; + + public readonly height: number; + public readonly contentHeight: number; + public readonly scrollHeight: number; + + constructor( + width: number, + contentWidth: number, + height: number, + contentHeight: number, + ) { + width = width | 0; + contentWidth = contentWidth | 0; + height = height | 0; + contentHeight = contentHeight | 0; + + if (width < 0) { + width = 0; + } + if (contentWidth < 0) { + contentWidth = 0; + } + + if (height < 0) { + height = 0; + } + if (contentHeight < 0) { + contentHeight = 0; + } + + this.width = width; + this.contentWidth = contentWidth; + this.scrollWidth = Math.max(width, contentWidth); + + this.height = height; + this.contentHeight = contentHeight; + this.scrollHeight = Math.max(height, contentHeight); + } + + public equals(other: EditorScrollDimensions): boolean { + return ( + this.width === other.width + && this.contentWidth === other.contentWidth + && this.height === other.height + && this.contentHeight === other.contentHeight + ); + } +} + +class EditorScrollable extends Disposable { + + private readonly _scrollable: Scrollable; + private _dimensions: EditorScrollDimensions; - public readonly scrollable: Scrollable; public readonly onDidScroll: Event; - constructor(configuration: editorCommon.IConfiguration, lineCount: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) { + private readonly _onDidContentSizeChange = this._register(new Emitter()); + public readonly onDidContentSizeChange: Event = this._onDidContentSizeChange.event; + + constructor(smoothScrollDuration: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) { + super(); + this._dimensions = new EditorScrollDimensions(0, 0, 0, 0); + this._scrollable = this._register(new Scrollable(smoothScrollDuration, scheduleAtNextAnimationFrame)); + this.onDidScroll = this._scrollable.onScroll; + } + + public getScrollable(): Scrollable { + return this._scrollable; + } + + public setSmoothScrollDuration(smoothScrollDuration: number): void { + this._scrollable.setSmoothScrollDuration(smoothScrollDuration); + } + + public validateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition { + return this._scrollable.validateScrollPosition(scrollPosition); + } + + public getScrollDimensions(): EditorScrollDimensions { + return this._dimensions; + } + + public setScrollDimensions(dimensions: EditorScrollDimensions): void { + if (this._dimensions.equals(dimensions)) { + return; + } + + const oldDimensions = this._dimensions; + this._dimensions = dimensions; + + this._scrollable.setScrollDimensions({ + width: dimensions.width, + scrollWidth: dimensions.scrollWidth, + height: dimensions.height, + scrollHeight: dimensions.scrollHeight + }); + + const contentWidthChanged = (oldDimensions.contentWidth !== dimensions.contentWidth); + const contentHeightChanged = (oldDimensions.contentHeight !== dimensions.contentHeight); + if (contentWidthChanged || contentHeightChanged) { + this._onDidContentSizeChange.fire({ + contentWidth: dimensions.contentWidth, + contentHeight: dimensions.contentHeight, + + contentWidthChanged: contentWidthChanged, + contentHeightChanged: contentHeightChanged + }); + } + } + + public getFutureScrollPosition(): IScrollPosition { + return this._scrollable.getFutureScrollPosition(); + } + + public getCurrentScrollPosition(): IScrollPosition { + return this._scrollable.getCurrentScrollPosition(); + } + + public setScrollPositionNow(update: INewScrollPosition): void { + this._scrollable.setScrollPositionNow(update); + } + + public setScrollPositionSmooth(update: INewScrollPosition): void { + this._scrollable.setScrollPositionSmooth(update); + } +} + +export class ViewLayout extends Disposable implements IViewLayout { + + private readonly _configuration: IConfiguration; + private readonly _linesLayout: LinesLayout; + + private readonly _scrollable: EditorScrollable; + public readonly onDidScroll: Event; + public readonly onDidContentSizeChange: Event; + + constructor(configuration: IConfiguration, lineCount: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) { super(); this._configuration = configuration; @@ -31,14 +164,17 @@ export class ViewLayout extends Disposable implements IViewLayout { this._linesLayout = new LinesLayout(lineCount, options.get(EditorOption.lineHeight)); - this.scrollable = this._register(new Scrollable(0, scheduleAtNextAnimationFrame)); + this._scrollable = this._register(new EditorScrollable(0, scheduleAtNextAnimationFrame)); this._configureSmoothScrollDuration(); - this.scrollable.setScrollDimensions({ - width: layoutInfo.contentWidth, - height: layoutInfo.contentHeight - }); - this.onDidScroll = this.scrollable.onScroll; + this._scrollable.setScrollDimensions(new EditorScrollDimensions( + layoutInfo.contentWidth, + 0, + layoutInfo.height, + 0 + )); + this.onDidScroll = this._scrollable.onDidScroll; + this.onDidContentSizeChange = this._scrollable.onDidContentSizeChange; this._updateHeight(); } @@ -47,12 +183,16 @@ export class ViewLayout extends Disposable implements IViewLayout { super.dispose(); } + public getScrollable(): Scrollable { + return this._scrollable.getScrollable(); + } + public onHeightMaybeChanged(): void { this._updateHeight(); } private _configureSmoothScrollDuration(): void { - this.scrollable.setSmoothScrollDuration(this._configuration.options.get(EditorOption.smoothScrolling) ? SMOOTH_SCROLLING_TIME : 0); + this._scrollable.setSmoothScrollDuration(this._configuration.options.get(EditorOption.smoothScrolling) ? SMOOTH_SCROLLING_TIME : 0); } // ---- begin view event handlers @@ -65,16 +205,15 @@ export class ViewLayout extends Disposable implements IViewLayout { if (e.hasChanged(EditorOption.layoutInfo)) { const layoutInfo = options.get(EditorOption.layoutInfo); const width = layoutInfo.contentWidth; - const height = layoutInfo.contentHeight; - const scrollDimensions = this.scrollable.getScrollDimensions(); + const height = layoutInfo.height; + const scrollDimensions = this._scrollable.getScrollDimensions(); const scrollWidth = scrollDimensions.scrollWidth; - const scrollHeight = this._getTotalHeight(width, height, scrollWidth); - - this.scrollable.setScrollDimensions({ - width: width, - height: height, - scrollHeight: scrollHeight - }); + this._scrollable.setScrollDimensions(new EditorScrollDimensions( + width, + scrollDimensions.contentWidth, + height, + this._getContentHeight(width, height, scrollWidth) + )); } else { this._updateHeight(); } @@ -108,7 +247,7 @@ export class ViewLayout extends Disposable implements IViewLayout { return scrollbar.horizontalScrollbarSize; } - private _getTotalHeight(width: number, height: number, scrollWidth: number): number { + private _getContentHeight(width: number, height: number, scrollWidth: number): number { const options = this._configuration.options; let result = this._linesLayout.getLinesTotalHeight(); @@ -118,25 +257,27 @@ export class ViewLayout extends Disposable implements IViewLayout { result += this._getHorizontalScrollbarHeight(width, scrollWidth); } - return Math.max(height, result); + return result; } private _updateHeight(): void { - const scrollDimensions = this.scrollable.getScrollDimensions(); + const scrollDimensions = this._scrollable.getScrollDimensions(); const width = scrollDimensions.width; const height = scrollDimensions.height; const scrollWidth = scrollDimensions.scrollWidth; - const scrollHeight = this._getTotalHeight(width, height, scrollWidth); - this.scrollable.setScrollDimensions({ - scrollHeight: scrollHeight - }); + this._scrollable.setScrollDimensions(new EditorScrollDimensions( + width, + scrollDimensions.contentWidth, + height, + this._getContentHeight(width, height, scrollWidth) + )); } // ---- Layouting logic public getCurrentViewport(): Viewport { - const scrollDimensions = this.scrollable.getScrollDimensions(); - const currentScrollPosition = this.scrollable.getCurrentScrollPosition(); + const scrollDimensions = this._scrollable.getScrollDimensions(); + const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); return new Viewport( currentScrollPosition.scrollTop, currentScrollPosition.scrollLeft, @@ -146,8 +287,8 @@ export class ViewLayout extends Disposable implements IViewLayout { } public getFutureViewport(): Viewport { - const scrollDimensions = this.scrollable.getScrollDimensions(); - const currentScrollPosition = this.scrollable.getFutureScrollPosition(); + const scrollDimensions = this._scrollable.getScrollDimensions(); + const currentScrollPosition = this._scrollable.getFutureScrollPosition(); return new Viewport( currentScrollPosition.scrollTop, currentScrollPosition.scrollLeft, @@ -156,23 +297,27 @@ export class ViewLayout extends Disposable implements IViewLayout { ); } - private _computeScrollWidth(maxLineWidth: number, viewportWidth: number): number { + private _computeContentWidth(maxLineWidth: number): number { const options = this._configuration.options; const wrappingInfo = options.get(EditorOption.wrappingInfo); let isViewportWrapping = wrappingInfo.isViewportWrapping; if (!isViewportWrapping) { const extraHorizontalSpace = options.get(EditorOption.scrollBeyondLastColumn) * options.get(EditorOption.fontInfo).typicalHalfwidthCharacterWidth; const whitespaceMinWidth = this._linesLayout.getWhitespaceMinWidth(); - return Math.max(maxLineWidth + extraHorizontalSpace, viewportWidth, whitespaceMinWidth); + return Math.max(maxLineWidth + extraHorizontalSpace, whitespaceMinWidth); } - return Math.max(maxLineWidth, viewportWidth); + return maxLineWidth; } public onMaxLineWidthChanged(maxLineWidth: number): void { - let newScrollWidth = this._computeScrollWidth(maxLineWidth, this.getCurrentViewport().width); - this.scrollable.setScrollDimensions({ - scrollWidth: newScrollWidth - }); + const scrollDimensions = this._scrollable.getScrollDimensions(); + // const newScrollWidth = ; + this._scrollable.setScrollDimensions(new EditorScrollDimensions( + scrollDimensions.width, + this._computeContentWidth(maxLineWidth), + scrollDimensions.height, + scrollDimensions.contentHeight + )); // The height might depend on the fact that there is a horizontal scrollbar or not this._updateHeight(); @@ -181,7 +326,7 @@ export class ViewLayout extends Disposable implements IViewLayout { // ---- view state public saveState(): { scrollTop: number; scrollTopWithoutViewZones: number; scrollLeft: number; } { - const currentScrollPosition = this.scrollable.getFutureScrollPosition(); + const currentScrollPosition = this._scrollable.getFutureScrollPosition(); let scrollTop = currentScrollPosition.scrollTop; let firstLineNumberInViewport = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(scrollTop); let whitespaceAboveFirstLine = this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(firstLineNumberInViewport); @@ -215,7 +360,7 @@ export class ViewLayout extends Disposable implements IViewLayout { } public getLinesViewportDataAtScrollTop(scrollTop: number): IPartialViewLinesViewportData { // do some minimal validations on scrollTop - const scrollDimensions = this.scrollable.getScrollDimensions(); + const scrollDimensions = this._scrollable.getScrollDimensions(); if (scrollTop + scrollDimensions.height > scrollDimensions.scrollHeight) { scrollTop = scrollDimensions.scrollHeight - scrollDimensions.height; } @@ -239,40 +384,47 @@ export class ViewLayout extends Disposable implements IViewLayout { // ---- IScrollingProvider - + public getContentWidth(): number { + const scrollDimensions = this._scrollable.getScrollDimensions(); + return scrollDimensions.contentWidth; + } public getScrollWidth(): number { - const scrollDimensions = this.scrollable.getScrollDimensions(); + const scrollDimensions = this._scrollable.getScrollDimensions(); return scrollDimensions.scrollWidth; } + public getContentHeight(): number { + const scrollDimensions = this._scrollable.getScrollDimensions(); + return scrollDimensions.contentHeight; + } public getScrollHeight(): number { - const scrollDimensions = this.scrollable.getScrollDimensions(); + const scrollDimensions = this._scrollable.getScrollDimensions(); return scrollDimensions.scrollHeight; } public getCurrentScrollLeft(): number { - const currentScrollPosition = this.scrollable.getCurrentScrollPosition(); + const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); return currentScrollPosition.scrollLeft; } public getCurrentScrollTop(): number { - const currentScrollPosition = this.scrollable.getCurrentScrollPosition(); + const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); return currentScrollPosition.scrollTop; } - public validateScrollPosition(scrollPosition: editorCommon.INewScrollPosition): IScrollPosition { - return this.scrollable.validateScrollPosition(scrollPosition); + public validateScrollPosition(scrollPosition: INewScrollPosition): IScrollPosition { + return this._scrollable.validateScrollPosition(scrollPosition); } - public setScrollPositionNow(position: editorCommon.INewScrollPosition): void { - this.scrollable.setScrollPositionNow(position); + public setScrollPositionNow(position: INewScrollPosition): void { + this._scrollable.setScrollPositionNow(position); } - public setScrollPositionSmooth(position: editorCommon.INewScrollPosition): void { - this.scrollable.setScrollPositionSmooth(position); + public setScrollPositionSmooth(position: INewScrollPosition): void { + this._scrollable.setScrollPositionSmooth(position); } public deltaScrollNow(deltaScrollLeft: number, deltaScrollTop: number): void { - const currentScrollPosition = this.scrollable.getCurrentScrollPosition(); - this.scrollable.setScrollPositionNow({ + const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); + this._scrollable.setScrollPositionNow({ scrollLeft: currentScrollPosition.scrollLeft + deltaScrollLeft, scrollTop: currentScrollPosition.scrollTop + deltaScrollTop }); diff --git a/src/vs/editor/common/viewLayout/viewLineRenderer.ts b/src/vs/editor/common/viewLayout/viewLineRenderer.ts index 5298d234529..c0b664a4553 100644 --- a/src/vs/editor/common/viewLayout/viewLineRenderer.ts +++ b/src/vs/editor/common/viewLayout/viewLineRenderer.ts @@ -66,7 +66,9 @@ export class RenderLineInput { public readonly lineTokens: IViewLineTokens; public readonly lineDecorations: LineDecoration[]; public readonly tabSize: number; + public readonly startVisibleColumn: number; public readonly spaceWidth: number; + public readonly middotWidth: number; public readonly stopRenderingLineAfter: number; public readonly renderWhitespace: RenderWhitespace; public readonly renderControlCharacters: boolean; @@ -89,7 +91,9 @@ export class RenderLineInput { lineTokens: IViewLineTokens, lineDecorations: LineDecoration[], tabSize: number, + startVisibleColumn: number, spaceWidth: number, + middotWidth: number, stopRenderingLineAfter: number, renderWhitespace: 'none' | 'boundary' | 'selection' | 'all', renderControlCharacters: boolean, @@ -106,7 +110,9 @@ export class RenderLineInput { this.lineTokens = lineTokens; this.lineDecorations = lineDecorations; this.tabSize = tabSize; + this.startVisibleColumn = startVisibleColumn; this.spaceWidth = spaceWidth; + this.middotWidth = middotWidth; this.stopRenderingLineAfter = stopRenderingLineAfter; this.renderWhitespace = ( renderWhitespace === 'all' @@ -154,6 +160,7 @@ export class RenderLineInput { && this.containsRTL === other.containsRTL && this.fauxIndentLength === other.fauxIndentLength && this.tabSize === other.tabSize + && this.startVisibleColumn === other.startVisibleColumn && this.spaceWidth === other.spaceWidth && this.stopRenderingLineAfter === other.stopRenderingLineAfter && this.renderWhitespace === other.renderWhitespace @@ -314,21 +321,24 @@ export function renderViewLine(input: RenderLineInput, sb: IStringBuilder): Rend if (input.lineDecorations.length > 0) { // This line is empty, but it contains inline decorations - let classNames: string[] = []; + const beforeClassNames: string[] = []; + const afterClassNames: string[] = []; for (let i = 0, len = input.lineDecorations.length; i < len; i++) { const lineDecoration = input.lineDecorations[i]; if (lineDecoration.type === InlineDecorationType.Before) { - classNames.push(input.lineDecorations[i].className); + beforeClassNames.push(input.lineDecorations[i].className); containsForeignElements |= ForeignElementType.Before; } if (lineDecoration.type === InlineDecorationType.After) { - classNames.push(input.lineDecorations[i].className); + afterClassNames.push(input.lineDecorations[i].className); containsForeignElements |= ForeignElementType.After; } } if (containsForeignElements !== ForeignElementType.None) { - content = ``; + const beforeSpan = (beforeClassNames.length > 0 ? `` : ``); + const afterSpan = (afterClassNames.length > 0 ? `` : ``); + content = `${beforeSpan}${afterSpan}`; } } @@ -368,9 +378,12 @@ class ResolvedRenderLineInput { public readonly isOverflowing: boolean, public readonly parts: LinePart[], public readonly containsForeignElements: ForeignElementType, + public readonly fauxIndentLength: number, public readonly tabSize: number, + public readonly startVisibleColumn: number, public readonly containsRTL: boolean, public readonly spaceWidth: number, + public readonly middotWidth: number, public readonly renderWhitespace: RenderWhitespace, public readonly renderControlCharacters: boolean, ) { @@ -395,7 +408,7 @@ function resolveRenderLineInput(input: RenderLineInput): ResolvedRenderLineInput let tokens = transformAndRemoveOverflowing(input.lineTokens, input.fauxIndentLength, len); if (input.renderWhitespace === RenderWhitespace.All || input.renderWhitespace === RenderWhitespace.Boundary || (input.renderWhitespace === RenderWhitespace.Selection && !!input.selectionsOnLine)) { - tokens = _applyRenderWhitespace(lineContent, len, input.continuesWithWrappedLine, tokens, input.fauxIndentLength, input.tabSize, useMonospaceOptimizations, input.selectionsOnLine, input.renderWhitespace === RenderWhitespace.Boundary); + tokens = _applyRenderWhitespace(lineContent, len, input.continuesWithWrappedLine, tokens, input.fauxIndentLength, input.tabSize, input.startVisibleColumn, useMonospaceOptimizations, input.selectionsOnLine, input.renderWhitespace === RenderWhitespace.Boundary); } let containsForeignElements = ForeignElementType.None; if (input.lineDecorations.length > 0) { @@ -425,9 +438,12 @@ function resolveRenderLineInput(input: RenderLineInput): ResolvedRenderLineInput isOverflowing, tokens, containsForeignElements, + input.fauxIndentLength, input.tabSize, + input.startVisibleColumn, input.containsRTL, input.spaceWidth, + input.middotWidth, input.renderWhitespace, input.renderControlCharacters ); @@ -537,7 +553,7 @@ function splitLargeTokens(lineContent: string, tokens: LinePart[], onlyAtSpaces: * Moreover, a token is created for every visual indent because on some fonts the glyphs used for rendering whitespace (→ or ·) do not have the same width as  . * The rendering phase will generate `style="width:..."` for these tokens. */ -function _applyRenderWhitespace(lineContent: string, len: number, continuesWithWrappedLine: boolean, tokens: LinePart[], fauxIndentLength: number, tabSize: number, useMonospaceOptimizations: boolean, selections: LineRange[] | null, onlyBoundary: boolean): LinePart[] { +function _applyRenderWhitespace(lineContent: string, len: number, continuesWithWrappedLine: boolean, tokens: LinePart[], fauxIndentLength: number, tabSize: number, startVisibleColumn: number, useMonospaceOptimizations: boolean, selections: LineRange[] | null, onlyBoundary: boolean): LinePart[] { let result: LinePart[] = [], resultLen = 0; let tokenIndex = 0; @@ -555,21 +571,10 @@ function _applyRenderWhitespace(lineContent: string, len: number, continuesWithW lastNonWhitespaceIndex = strings.lastNonWhitespaceIndex(lineContent); } - let tmpIndent = 0; - for (let charIndex = 0; charIndex < fauxIndentLength; charIndex++) { - const chCode = lineContent.charCodeAt(charIndex); - if (chCode === CharCode.Tab) { - tmpIndent = tabSize; - } else if (strings.isFullWidthCharacter(chCode)) { - tmpIndent += 2; - } else { - tmpIndent++; - } - } - tmpIndent = tmpIndent % tabSize; let wasInWhitespace = false; let currentSelectionIndex = 0; let currentSelection = selections && selections[currentSelectionIndex]; + let tmpIndent = startVisibleColumn % tabSize; for (let charIndex = fauxIndentLength; charIndex < len; charIndex++) { const chCode = lineContent.charCodeAt(charIndex); @@ -729,16 +734,22 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render const len = input.len; const isOverflowing = input.isOverflowing; const parts = input.parts; + const fauxIndentLength = input.fauxIndentLength; const tabSize = input.tabSize; + const startVisibleColumn = input.startVisibleColumn; const containsRTL = input.containsRTL; const spaceWidth = input.spaceWidth; + const middotWidth = input.middotWidth; const renderWhitespace = input.renderWhitespace; const renderControlCharacters = input.renderControlCharacters; + // use U+2E31 - WORD SEPARATOR MIDDLE DOT or U+00B7 - MIDDLE DOT + const spaceRenderWhitespaceCharacter = (middotWidth > spaceWidth ? 0x2E31 : 0xB7); + const characterMapping = new CharacterMapping(len + 1, parts.length); let charIndex = 0; - let tabsCharDelta = 0; + let visibleColumn = startVisibleColumn; let charOffsetInPart = 0; let prevPartContentCnt = 0; @@ -764,18 +775,14 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render let partContentCnt = 0; { let _charIndex = charIndex; - let _tabsCharDelta = tabsCharDelta; + let _visibleColumn = visibleColumn; for (; _charIndex < partEndIndex; _charIndex++) { const charCode = lineContent.charCodeAt(_charIndex); - - if (charCode === CharCode.Tab) { - let insertSpacesCount = tabSize - (_charIndex + _tabsCharDelta) % tabSize; - _tabsCharDelta += insertSpacesCount - 1; - partContentCnt += insertSpacesCount; - } else { - // must be CharCode.Space - partContentCnt++; + const charWidth = (charCode === CharCode.Tab ? (tabSize - (_visibleColumn % tabSize)) : 1) | 0; + partContentCnt += charWidth; + if (_charIndex >= fauxIndentLength) { + _visibleColumn += charWidth; } } } @@ -793,29 +800,30 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render for (; charIndex < partEndIndex; charIndex++) { characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset); const charCode = lineContent.charCodeAt(charIndex); + let charWidth: number; if (charCode === CharCode.Tab) { - let insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize; - tabsCharDelta += insertSpacesCount - 1; - charOffsetInPart += insertSpacesCount - 1; - if (insertSpacesCount > 0) { - if (!canUseHalfwidthRightwardsArrow || insertSpacesCount > 1) { - sb.write1(0x2192); // RIGHTWARDS ARROW - } else { - sb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW - } - insertSpacesCount--; + charWidth = (tabSize - (visibleColumn % tabSize)) | 0; + + if (!canUseHalfwidthRightwardsArrow || charWidth > 1) { + sb.write1(0x2192); // RIGHTWARDS ARROW + } else { + sb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW } - while (insertSpacesCount > 0) { + for (let space = 2; space <= charWidth; space++) { sb.write1(0xA0); //   - insertSpacesCount--; } - } else { - // must be CharCode.Space - sb.write1(0xB7); // · + + } else { // must be CharCode.Space + charWidth = 1; + + sb.write1(spaceRenderWhitespaceCharacter); // · or word separator middle dot } - charOffsetInPart++; + charOffsetInPart += charWidth; + if (charIndex >= fauxIndentLength) { + visibleColumn += charWidth; + } } prevPartContentCnt = partContentCnt; @@ -833,63 +841,59 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset); const charCode = lineContent.charCodeAt(charIndex); + let producedCharacters = 1; + let charWidth = 1; + switch (charCode) { case CharCode.Tab: - let insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize; - tabsCharDelta += insertSpacesCount - 1; - charOffsetInPart += insertSpacesCount - 1; - while (insertSpacesCount > 0) { + producedCharacters = (tabSize - (visibleColumn % tabSize)); + charWidth = producedCharacters; + for (let space = 1; space <= producedCharacters; space++) { sb.write1(0xA0); //   - partContentCnt++; - insertSpacesCount--; } break; case CharCode.Space: sb.write1(0xA0); //   - partContentCnt++; break; case CharCode.LessThan: sb.appendASCIIString('<'); - partContentCnt++; break; case CharCode.GreaterThan: sb.appendASCIIString('>'); - partContentCnt++; break; case CharCode.Ampersand: sb.appendASCIIString('&'); - partContentCnt++; break; case CharCode.Null: sb.appendASCIIString('�'); - partContentCnt++; break; case CharCode.UTF8_BOM: case CharCode.LINE_SEPARATOR_2028: sb.write1(0xFFFD); - partContentCnt++; break; default: if (strings.isFullWidthCharacter(charCode)) { - tabsCharDelta++; + charWidth++; } if (renderControlCharacters && charCode < 32) { sb.write1(9216 + charCode); - partContentCnt++; } else { sb.write1(charCode); - partContentCnt++; } } - charOffsetInPart++; + charOffsetInPart += producedCharacters; + partContentCnt += producedCharacters; + if (charIndex >= fauxIndentLength) { + visibleColumn += charWidth; + } } prevPartContentCnt = partContentCnt; diff --git a/src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts b/src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts deleted file mode 100644 index bbf71e817b9..00000000000 --- a/src/vs/editor/common/viewModel/characterHardWrappingLineMapper.ts +++ /dev/null @@ -1,293 +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 { CharCode } from 'vs/base/common/charCode'; -import * as strings from 'vs/base/common/strings'; -import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; -import { CharacterClassifier } from 'vs/editor/common/core/characterClassifier'; -import { toUint32Array } from 'vs/base/common/uint'; -import { PrefixSumComputer } from 'vs/editor/common/viewModel/prefixSumComputer'; -import { ILineMapperFactory, ILineMapping, OutputPosition } from 'vs/editor/common/viewModel/splitLinesCollection'; - -const enum CharacterClass { - NONE = 0, - BREAK_BEFORE = 1, - BREAK_AFTER = 2, - BREAK_OBTRUSIVE = 3, - BREAK_IDEOGRAPHIC = 4 // for Han and Kana. -} - -class WrappingCharacterClassifier extends CharacterClassifier { - - constructor(BREAK_BEFORE: string, BREAK_AFTER: string, BREAK_OBTRUSIVE: string) { - super(CharacterClass.NONE); - - for (let i = 0; i < BREAK_BEFORE.length; i++) { - this.set(BREAK_BEFORE.charCodeAt(i), CharacterClass.BREAK_BEFORE); - } - - for (let i = 0; i < BREAK_AFTER.length; i++) { - this.set(BREAK_AFTER.charCodeAt(i), CharacterClass.BREAK_AFTER); - } - - for (let i = 0; i < BREAK_OBTRUSIVE.length; i++) { - this.set(BREAK_OBTRUSIVE.charCodeAt(i), CharacterClass.BREAK_OBTRUSIVE); - } - } - - public get(charCode: number): CharacterClass { - // Initialize CharacterClass.BREAK_IDEOGRAPHIC for these Unicode ranges: - // 1. CJK Unified Ideographs (0x4E00 -- 0x9FFF) - // 2. CJK Unified Ideographs Extension A (0x3400 -- 0x4DBF) - // 3. Hiragana and Katakana (0x3040 -- 0x30FF) - if ( - (charCode >= 0x3040 && charCode <= 0x30FF) - || (charCode >= 0x3400 && charCode <= 0x4DBF) - || (charCode >= 0x4E00 && charCode <= 0x9FFF) - ) { - return CharacterClass.BREAK_IDEOGRAPHIC; - } - - return super.get(charCode); - } -} - -export class CharacterHardWrappingLineMapperFactory implements ILineMapperFactory { - - private readonly classifier: WrappingCharacterClassifier; - - constructor(breakBeforeChars: string, breakAfterChars: string, breakObtrusiveChars: string) { - this.classifier = new WrappingCharacterClassifier(breakBeforeChars, breakAfterChars, breakObtrusiveChars); - } - - // TODO@Alex -> duplicated in lineCommentCommand - private static nextVisibleColumn(currentVisibleColumn: number, tabSize: number, isTab: boolean, columnSize: number): number { - currentVisibleColumn = +currentVisibleColumn; //@perf - tabSize = +tabSize; //@perf - columnSize = +columnSize; //@perf - - if (isTab) { - return currentVisibleColumn + (tabSize - (currentVisibleColumn % tabSize)); - } - return currentVisibleColumn + columnSize; - } - - public createLineMapping(lineText: string, tabSize: number, breakingColumn: number, columnsForFullWidthChar: number, hardWrappingIndent: WrappingIndent): ILineMapping | null { - if (breakingColumn === -1) { - return null; - } - - tabSize = +tabSize; //@perf - breakingColumn = +breakingColumn; //@perf - columnsForFullWidthChar = +columnsForFullWidthChar; //@perf - hardWrappingIndent = +hardWrappingIndent; //@perf - - let wrappedTextIndentVisibleColumn = 0; - let wrappedTextIndent = ''; - - let firstNonWhitespaceIndex = -1; - if (hardWrappingIndent !== WrappingIndent.None) { - firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineText); - if (firstNonWhitespaceIndex !== -1) { - // Track existing indent - wrappedTextIndent = lineText.substring(0, firstNonWhitespaceIndex); - for (let i = 0; i < firstNonWhitespaceIndex; i++) { - wrappedTextIndentVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(wrappedTextIndentVisibleColumn, tabSize, lineText.charCodeAt(i) === CharCode.Tab, 1); - } - - // Increase indent of continuation lines, if desired - let numberOfAdditionalTabs = 0; - if (hardWrappingIndent === WrappingIndent.Indent) { - numberOfAdditionalTabs = 1; - } else if (hardWrappingIndent === WrappingIndent.DeepIndent) { - numberOfAdditionalTabs = 2; - } - for (let i = 0; i < numberOfAdditionalTabs; i++) { - wrappedTextIndent += '\t'; - wrappedTextIndentVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(wrappedTextIndentVisibleColumn, tabSize, true, 1); - } - - // Force sticking to beginning of line if no character would fit except for the indentation - if (wrappedTextIndentVisibleColumn + columnsForFullWidthChar > breakingColumn) { - wrappedTextIndent = ''; - wrappedTextIndentVisibleColumn = 0; - } - } - } - - let classifier = this.classifier; - let lastBreakingOffset = 0; // Last 0-based offset in the lineText at which a break happened - let breakingLengths: number[] = []; // The length of each broken-up line text - let breakingLengthsIndex: number = 0; // The count of breaks already done - let visibleColumn = 0; // Visible column since the beginning of the current line - let niceBreakOffset = -1; // Last index of a character that indicates a break should happen before it (more desirable) - let niceBreakVisibleColumn = 0; // visible column if a break were to be later introduced before `niceBreakOffset` - let obtrusiveBreakOffset = -1; // Last index of a character that indicates a break should happen before it (less desirable) - let obtrusiveBreakVisibleColumn = 0; // visible column if a break were to be later introduced before `obtrusiveBreakOffset` - let len = lineText.length; - - for (let i = 0; i < len; i++) { - // At this point, there is a certainty that the character before `i` fits on the current line, - // but the character at `i` might not fit - - let charCode = lineText.charCodeAt(i); - let charCodeIsTab = (charCode === CharCode.Tab); - let charCodeClass = classifier.get(charCode); - - if (strings.isLowSurrogate(charCode)/* && i + 1 < len */) { - // A surrogate pair must always be considered as a single unit, so it is never to be broken - // => advance visibleColumn by 1 and advance to next char code... - visibleColumn = visibleColumn + 1; - continue; - } - - if (charCodeClass === CharacterClass.BREAK_BEFORE) { - // This is a character that indicates that a break should happen before it - // Since we are certain the character before `i` fits, there's no extra checking needed, - // just mark it as a nice breaking opportunity - niceBreakOffset = i; - niceBreakVisibleColumn = wrappedTextIndentVisibleColumn; - } - - // CJK breaking : before break - if (charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && i > 0) { - let prevCode = lineText.charCodeAt(i - 1); - let prevClass = classifier.get(prevCode); - if (prevClass !== CharacterClass.BREAK_BEFORE) { // Kinsoku Shori: Don't break after a leading character, like an open bracket - niceBreakOffset = i; - niceBreakVisibleColumn = wrappedTextIndentVisibleColumn; - } - } - - let charColumnSize = 1; - if (strings.isFullWidthCharacter(charCode)) { - charColumnSize = columnsForFullWidthChar; - } - - // Advance visibleColumn with character at `i` - visibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(visibleColumn, tabSize, charCodeIsTab, charColumnSize); - - if (visibleColumn > breakingColumn && i !== 0) { - // We need to break at least before character at `i`: - // - break before niceBreakLastOffset if it exists (and re-establish a correct visibleColumn by using niceBreakVisibleColumn + charAt(i)) - // - otherwise, break before obtrusiveBreakLastOffset if it exists (and re-establish a correct visibleColumn by using obtrusiveBreakVisibleColumn + charAt(i)) - // - otherwise, break before i (and re-establish a correct visibleColumn by charAt(i)) - - let breakBeforeOffset: number; - let restoreVisibleColumnFrom: number; - - if (niceBreakOffset !== -1 && niceBreakVisibleColumn <= breakingColumn) { - - // We will break before `niceBreakLastOffset` - breakBeforeOffset = niceBreakOffset; - restoreVisibleColumnFrom = niceBreakVisibleColumn; - - } else if (obtrusiveBreakOffset !== -1 && obtrusiveBreakVisibleColumn <= breakingColumn) { - - // We will break before `obtrusiveBreakLastOffset` - breakBeforeOffset = obtrusiveBreakOffset; - restoreVisibleColumnFrom = obtrusiveBreakVisibleColumn; - - } else { - - // We will break before `i` - breakBeforeOffset = i; - restoreVisibleColumnFrom = wrappedTextIndentVisibleColumn; - - } - - // Break before character at `breakBeforeOffset` - breakingLengths[breakingLengthsIndex++] = breakBeforeOffset - lastBreakingOffset; - lastBreakingOffset = breakBeforeOffset; - - // Re-establish visibleColumn by taking character at `i` into account - visibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(restoreVisibleColumnFrom, tabSize, charCodeIsTab, charColumnSize); - - // Reset markers - niceBreakOffset = -1; - niceBreakVisibleColumn = 0; - obtrusiveBreakOffset = -1; - obtrusiveBreakVisibleColumn = 0; - } - - // At this point, there is a certainty that the character at `i` fits on the current line - - if (niceBreakOffset !== -1) { - // Advance niceBreakVisibleColumn - niceBreakVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(niceBreakVisibleColumn, tabSize, charCodeIsTab, charColumnSize); - } - if (obtrusiveBreakOffset !== -1) { - // Advance obtrusiveBreakVisibleColumn - obtrusiveBreakVisibleColumn = CharacterHardWrappingLineMapperFactory.nextVisibleColumn(obtrusiveBreakVisibleColumn, tabSize, charCodeIsTab, charColumnSize); - } - - if (charCodeClass === CharacterClass.BREAK_AFTER && (hardWrappingIndent === WrappingIndent.None || i >= firstNonWhitespaceIndex)) { - // This is a character that indicates that a break should happen after it - niceBreakOffset = i + 1; - niceBreakVisibleColumn = wrappedTextIndentVisibleColumn; - } - - // CJK breaking : after break - if (charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && i < len - 1) { - let nextCode = lineText.charCodeAt(i + 1); - let nextClass = classifier.get(nextCode); - if (nextClass !== CharacterClass.BREAK_AFTER) { // Kinsoku Shori: Don't break before a trailing character, like a period - niceBreakOffset = i + 1; - niceBreakVisibleColumn = wrappedTextIndentVisibleColumn; - } - } - - if (charCodeClass === CharacterClass.BREAK_OBTRUSIVE) { - // This is an obtrusive character that indicates that a break should happen after it - obtrusiveBreakOffset = i + 1; - obtrusiveBreakVisibleColumn = wrappedTextIndentVisibleColumn; - } - } - - if (breakingLengthsIndex === 0) { - return null; - } - - // Add last segment - breakingLengths[breakingLengthsIndex++] = len - lastBreakingOffset; - - return new CharacterHardWrappingLineMapping( - new PrefixSumComputer(toUint32Array(breakingLengths)), - wrappedTextIndent - ); - } -} - -export class CharacterHardWrappingLineMapping implements ILineMapping { - - private readonly _prefixSums: PrefixSumComputer; - private readonly _wrappedLinesIndent: string; - - constructor(prefixSums: PrefixSumComputer, wrappedLinesIndent: string) { - this._prefixSums = prefixSums; - this._wrappedLinesIndent = wrappedLinesIndent; - } - - public getOutputLineCount(): number { - return this._prefixSums.getCount(); - } - - public getWrappedLinesIndent(): string { - return this._wrappedLinesIndent; - } - - public getInputOffsetOfOutputPosition(outputLineIndex: number, outputOffset: number): number { - if (outputLineIndex === 0) { - return outputOffset; - } else { - return this._prefixSums.getAccumulatedValue(outputLineIndex - 1) + outputOffset; - } - } - - public getOutputPositionOfInputOffset(inputOffset: number): OutputPosition { - let r = this._prefixSums.getIndexOf(inputOffset); - return new OutputPosition(r.index, r.remainder); - } -} diff --git a/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts b/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts new file mode 100644 index 00000000000..97a3c4a7655 --- /dev/null +++ b/src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts @@ -0,0 +1,472 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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 { ILineBreaksComputerFactory, LineBreakData, ILineBreaksComputer } from 'vs/editor/common/viewModel/splitLinesCollection'; +import { FontInfo } from 'vs/editor/common/config/fontInfo'; + +const enum CharacterClass { + NONE = 0, + BREAK_BEFORE = 1, + BREAK_AFTER = 2, + BREAK_IDEOGRAPHIC = 3 // for Han and Kana. +} + +class WrappingCharacterClassifier extends CharacterClassifier { + + constructor(BREAK_BEFORE: string, BREAK_AFTER: string) { + super(CharacterClass.NONE); + + for (let i = 0; i < BREAK_BEFORE.length; i++) { + this.set(BREAK_BEFORE.charCodeAt(i), CharacterClass.BREAK_BEFORE); + } + + for (let i = 0; i < BREAK_AFTER.length; i++) { + this.set(BREAK_AFTER.charCodeAt(i), CharacterClass.BREAK_AFTER); + } + } + + public get(charCode: number): CharacterClass { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } else { + // Initialize CharacterClass.BREAK_IDEOGRAPHIC for these Unicode ranges: + // 1. CJK Unified Ideographs (0x4E00 -- 0x9FFF) + // 2. CJK Unified Ideographs Extension A (0x3400 -- 0x4DBF) + // 3. Hiragana and Katakana (0x3040 -- 0x30FF) + if ( + (charCode >= 0x3040 && charCode <= 0x30FF) + || (charCode >= 0x3400 && charCode <= 0x4DBF) + || (charCode >= 0x4E00 && charCode <= 0x9FFF) + ) { + return CharacterClass.BREAK_IDEOGRAPHIC; + } + + return (this._map.get(charCode) || this._defaultValue); + } + } +} + +let arrPool1: number[] = []; +let arrPool2: number[] = []; + +export class MonospaceLineBreaksComputerFactory implements ILineBreaksComputerFactory { + + public static create(options: IComputedEditorOptions): MonospaceLineBreaksComputerFactory { + return new MonospaceLineBreaksComputerFactory( + options.get(EditorOption.wordWrapBreakBeforeCharacters), + options.get(EditorOption.wordWrapBreakAfterCharacters) + ); + } + + private readonly classifier: WrappingCharacterClassifier; + + constructor(breakBeforeChars: string, breakAfterChars: string) { + this.classifier = new WrappingCharacterClassifier(breakBeforeChars, breakAfterChars); + } + + public createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer { + tabSize = tabSize | 0; //@perf + wrappingColumn = +wrappingColumn; //@perf + + let requests: string[] = []; + let previousBreakingData: (LineBreakData | null)[] = []; + return { + addRequest: (lineText: string, previousLineBreakData: LineBreakData | null) => { + requests.push(lineText); + previousBreakingData.push(previousLineBreakData); + }, + finalize: () => { + const columnsForFullWidthChar = fontInfo.typicalFullwidthCharacterWidth / fontInfo.typicalHalfwidthCharacterWidth; //@perf + let result: (LineBreakData | null)[] = []; + for (let i = 0, len = requests.length; i < len; i++) { + const previousLineBreakData = previousBreakingData[i]; + if (previousLineBreakData) { + result[i] = createLineBreaksFromPreviousLineBreaks(this.classifier, previousLineBreakData, requests[i], tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent); + } else { + result[i] = createLineBreaks(this.classifier, requests[i], tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent); + } + } + arrPool1.length = 0; + arrPool2.length = 0; + return result; + } + }; + } +} + +function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterClassifier, previousBreakingData: LineBreakData, lineText: string, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): LineBreakData | null { + if (firstLineBreakColumn === -1) { + return null; + } + + const len = lineText.length; + if (len <= 1) { + return null; + } + + const prevBreakingOffsets = previousBreakingData.breakOffsets; + const prevBreakingOffsetsVisibleColumn = previousBreakingData.breakOffsetsVisibleColumn; + + const wrappedTextIndentLength = computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent); + const wrappedLineBreakColumn = firstLineBreakColumn - wrappedTextIndentLength; + + let breakingOffsets: number[] = arrPool1; + let breakingOffsetsVisibleColumn: number[] = arrPool2; + let breakingOffsetsCount: number = 0; + + let breakingColumn = firstLineBreakColumn; + const prevLen = prevBreakingOffsets.length; + let prevIndex = 0; + + if (prevIndex >= 0) { + let bestDistance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex] - breakingColumn); + while (prevIndex + 1 < prevLen) { + const distance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex + 1] - breakingColumn); + if (distance >= bestDistance) { + break; + } + bestDistance = distance; + prevIndex++; + } + } + + while (prevIndex < prevLen) { + // Allow for prevIndex to be -1 (for the case where we hit a tab when walking backwards from the first break) + const prevBreakOffset = prevIndex < 0 ? 0 : prevBreakingOffsets[prevIndex]; + const prevBreakoffsetVisibleColumn = prevIndex < 0 ? 0 : prevBreakingOffsetsVisibleColumn[prevIndex]; + + let breakOffset = 0; + let breakOffsetVisibleColumn = 0; + + let forcedBreakOffset = 0; + let forcedBreakOffsetVisibleColumn = 0; + + // initially, we search as much as possible to the right (if it fits) + if (prevBreakoffsetVisibleColumn <= breakingColumn) { + let visibleColumn = prevBreakoffsetVisibleColumn; + let prevCharCode = lineText.charCodeAt(prevBreakOffset - 1); + let prevCharCodeClass = classifier.get(prevCharCode); + let entireLineFits = true; + for (let i = prevBreakOffset; i < len; i++) { + const charStartOffset = i; + const charCode = lineText.charCodeAt(i); + let charCodeClass: number; + let charWidth: number; + + if (strings.isHighSurrogate(charCode)) { + // A surrogate pair must always be considered as a single unit, so it is never to be broken + i++; + charCodeClass = CharacterClass.NONE; + charWidth = 2; + } else { + charCodeClass = classifier.get(charCode); + charWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar); + } + + if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) { + breakOffset = charStartOffset; + breakOffsetVisibleColumn = visibleColumn; + } + + visibleColumn += charWidth; + + // check if adding character at `i` will go over the breaking column + if (visibleColumn > breakingColumn) { + // We need to break at least before character at `i`: + forcedBreakOffset = charStartOffset; + forcedBreakOffsetVisibleColumn = visibleColumn - charWidth; + + if (visibleColumn - breakOffsetVisibleColumn > wrappedLineBreakColumn) { + // Cannot break at `breakOffset` => reset it if it was set + breakOffset = 0; + } + + entireLineFits = false; + break; + } + + prevCharCode = charCode; + prevCharCodeClass = charCodeClass; + } + + if (entireLineFits) { + // there is no more need to break => stop the outer loop! + if (breakingOffsetsCount > 0) { + // Add last segment + breakingOffsets[breakingOffsetsCount] = prevBreakingOffsets[prevBreakingOffsets.length - 1]; + breakingOffsetsVisibleColumn[breakingOffsetsCount] = prevBreakingOffsetsVisibleColumn[prevBreakingOffsets.length - 1]; + breakingOffsetsCount++; + } + break; + } + } + + if (breakOffset === 0) { + // must search left + let visibleColumn = prevBreakoffsetVisibleColumn; + let charCode = lineText.charCodeAt(prevBreakOffset); + let charCodeClass = classifier.get(charCode); + let hitATabCharacter = false; + for (let i = prevBreakOffset - 1; i >= 0; i--) { + const charStartOffset = i + 1; + const prevCharCode = lineText.charCodeAt(i); + + if (prevCharCode === CharCode.Tab) { + // cannot determine the width of a tab when going backwards, so we must go forwards + hitATabCharacter = true; + break; + } + + let prevCharCodeClass: number; + let prevCharWidth: number; + + if (strings.isLowSurrogate(prevCharCode)) { + // A surrogate pair must always be considered as a single unit, so it is never to be broken + i--; + prevCharCodeClass = CharacterClass.NONE; + prevCharWidth = 2; + } else { + prevCharCodeClass = classifier.get(prevCharCode); + prevCharWidth = (strings.isFullWidthCharacter(prevCharCode) ? columnsForFullWidthChar : 1); + } + + if (visibleColumn <= breakingColumn) { + if (forcedBreakOffset === 0) { + forcedBreakOffset = charStartOffset; + forcedBreakOffsetVisibleColumn = visibleColumn; + } + + if (visibleColumn <= breakingColumn - wrappedLineBreakColumn) { + // went too far! + break; + } + + if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) { + breakOffset = charStartOffset; + breakOffsetVisibleColumn = visibleColumn; + break; + } + } + + visibleColumn -= prevCharWidth; + charCode = prevCharCode; + charCodeClass = prevCharCodeClass; + } + + if (breakOffset !== 0) { + const remainingWidthOfNextLine = wrappedLineBreakColumn - (forcedBreakOffsetVisibleColumn - breakOffsetVisibleColumn); + if (remainingWidthOfNextLine <= tabSize) { + const charCodeAtForcedBreakOffset = lineText.charCodeAt(forcedBreakOffset); + let charWidth: number; + if (strings.isHighSurrogate(charCodeAtForcedBreakOffset)) { + // A surrogate pair must always be considered as a single unit, so it is never to be broken + charWidth = 2; + } else { + charWidth = computeCharWidth(charCodeAtForcedBreakOffset, forcedBreakOffsetVisibleColumn, tabSize, columnsForFullWidthChar); + } + if (remainingWidthOfNextLine - charWidth < 0) { + // it is not worth it to break at breakOffset, it just introduces an extra needless line! + breakOffset = 0; + } + } + } + + if (hitATabCharacter) { + // cannot determine the width of a tab when going backwards, so we must go forwards from the previous break + prevIndex--; + continue; + } + } + + if (breakOffset === 0) { + // Could not find a good breaking point + breakOffset = forcedBreakOffset; + breakOffsetVisibleColumn = forcedBreakOffsetVisibleColumn; + } + + breakingOffsets[breakingOffsetsCount] = breakOffset; + breakingOffsetsVisibleColumn[breakingOffsetsCount] = breakOffsetVisibleColumn; + breakingOffsetsCount++; + breakingColumn = breakOffsetVisibleColumn + wrappedLineBreakColumn; + + while (prevIndex < 0 || (prevIndex < prevLen && prevBreakingOffsetsVisibleColumn[prevIndex] < breakOffsetVisibleColumn)) { + prevIndex++; + } + + let bestDistance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex] - breakingColumn); + while (prevIndex + 1 < prevLen) { + const distance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex + 1] - breakingColumn); + if (distance >= bestDistance) { + break; + } + bestDistance = distance; + prevIndex++; + } + } + + if (breakingOffsetsCount === 0) { + return null; + } + + // Doing here some object reuse which ends up helping a huge deal with GC pauses! + breakingOffsets.length = breakingOffsetsCount; + breakingOffsetsVisibleColumn.length = breakingOffsetsCount; + arrPool1 = previousBreakingData.breakOffsets; + arrPool2 = previousBreakingData.breakOffsetsVisibleColumn; + previousBreakingData.breakOffsets = breakingOffsets; + previousBreakingData.breakOffsetsVisibleColumn = breakingOffsetsVisibleColumn; + previousBreakingData.wrappedTextIndentLength = wrappedTextIndentLength; + return previousBreakingData; +} + +function createLineBreaks(classifier: WrappingCharacterClassifier, lineText: string, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): LineBreakData | null { + if (firstLineBreakColumn === -1) { + return null; + } + + const len = lineText.length; + if (len <= 1) { + return null; + } + + const wrappedTextIndentLength = computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent); + const wrappedLineBreakColumn = firstLineBreakColumn - wrappedTextIndentLength; + + let breakingOffsets: number[] = []; + let breakingOffsetsVisibleColumn: number[] = []; + let breakingOffsetsCount: number = 0; + let breakOffset = 0; + let breakOffsetVisibleColumn = 0; + + let breakingColumn = firstLineBreakColumn; + let prevCharCode = lineText.charCodeAt(0); + let prevCharCodeClass = classifier.get(prevCharCode); + let visibleColumn = computeCharWidth(prevCharCode, 0, tabSize, columnsForFullWidthChar); + + let startOffset = 1; + if (strings.isHighSurrogate(prevCharCode)) { + // A surrogate pair must always be considered as a single unit, so it is never to be broken + visibleColumn += 1; + prevCharCode = lineText.charCodeAt(1); + prevCharCodeClass = classifier.get(prevCharCode); + startOffset++; + } + + for (let i = startOffset; i < len; i++) { + const charStartOffset = i; + const charCode = lineText.charCodeAt(i); + let charCodeClass: number; + let charWidth: number; + + if (strings.isHighSurrogate(charCode)) { + // A surrogate pair must always be considered as a single unit, so it is never to be broken + i++; + charCodeClass = CharacterClass.NONE; + charWidth = 2; + } else { + charCodeClass = classifier.get(charCode); + charWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar); + } + + if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) { + breakOffset = charStartOffset; + breakOffsetVisibleColumn = visibleColumn; + } + + visibleColumn += charWidth; + + // check if adding character at `i` will go over the breaking column + if (visibleColumn > breakingColumn) { + // We need to break at least before character at `i`: + + if (breakOffset === 0 || visibleColumn - breakOffsetVisibleColumn > wrappedLineBreakColumn) { + // Cannot break at `breakOffset`, must break at `i` + breakOffset = charStartOffset; + breakOffsetVisibleColumn = visibleColumn - charWidth; + } + + breakingOffsets[breakingOffsetsCount] = breakOffset; + breakingOffsetsVisibleColumn[breakingOffsetsCount] = breakOffsetVisibleColumn; + breakingOffsetsCount++; + breakingColumn = breakOffsetVisibleColumn + wrappedLineBreakColumn; + breakOffset = 0; + } + + prevCharCode = charCode; + prevCharCodeClass = charCodeClass; + } + + if (breakingOffsetsCount === 0) { + return null; + } + + // Add last segment + breakingOffsets[breakingOffsetsCount] = len; + breakingOffsetsVisibleColumn[breakingOffsetsCount] = visibleColumn; + + return new LineBreakData(breakingOffsets, breakingOffsetsVisibleColumn, wrappedTextIndentLength); +} + +function computeCharWidth(charCode: number, visibleColumn: number, tabSize: number, columnsForFullWidthChar: number): number { + if (charCode === CharCode.Tab) { + return (tabSize - (visibleColumn % tabSize)); + } + if (strings.isFullWidthCharacter(charCode)) { + return columnsForFullWidthChar; + } + return 1; +} + +function tabCharacterWidth(visibleColumn: number, tabSize: number): number { + return (tabSize - (visibleColumn % tabSize)); +} + +/** + * Kinsoku Shori : Don't break after a leading character, like an open bracket + * Kinsoku Shori : Don't break before a trailing character, like a period + */ +function canBreak(prevCharCode: number, prevCharCodeClass: CharacterClass, charCode: number, charCodeClass: CharacterClass): boolean { + return ( + charCode !== CharCode.Space + && ( + (prevCharCodeClass === CharacterClass.BREAK_AFTER) + || (prevCharCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && charCodeClass !== CharacterClass.BREAK_AFTER) + || (charCodeClass === CharacterClass.BREAK_BEFORE) + || (charCodeClass === CharacterClass.BREAK_IDEOGRAPHIC && prevCharCodeClass !== CharacterClass.BREAK_BEFORE) + ) + ); +} + +function computeWrappedTextIndentLength(lineText: string, tabSize: number, firstLineBreakColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): number { + let wrappedTextIndentLength = 0; + if (wrappingIndent !== WrappingIndent.None) { + const firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineText); + if (firstNonWhitespaceIndex !== -1) { + // Track existing indent + + for (let i = 0; i < firstNonWhitespaceIndex; i++) { + const charWidth = (lineText.charCodeAt(i) === CharCode.Tab ? tabCharacterWidth(wrappedTextIndentLength, tabSize) : 1); + wrappedTextIndentLength += charWidth; + } + + // Increase indent of continuation lines, if desired + const numberOfAdditionalTabs = (wrappingIndent === WrappingIndent.DeepIndent ? 2 : wrappingIndent === WrappingIndent.Indent ? 1 : 0); + for (let i = 0; i < numberOfAdditionalTabs; i++) { + const charWidth = tabCharacterWidth(wrappedTextIndentLength, tabSize); + wrappedTextIndentLength += charWidth; + } + + // Force sticking to beginning of line if no character would fit except for the indentation + if (wrappedTextIndentLength + columnsForFullWidthChar > firstLineBreakColumn) { + wrappedTextIndentLength = 0; + } + } + } + return wrappedTextIndentLength; +} diff --git a/src/vs/editor/common/viewModel/prefixSumComputer.ts b/src/vs/editor/common/viewModel/prefixSumComputer.ts index d4e8c1f0df2..6cb1312c07e 100644 --- a/src/vs/editor/common/viewModel/prefixSumComputer.ts +++ b/src/vs/editor/common/viewModel/prefixSumComputer.ts @@ -187,73 +187,3 @@ export class PrefixSumComputer { return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); } } - -export class PrefixSumComputerWithCache { - - private readonly _actual: PrefixSumComputer; - private _cacheAccumulatedValueStart: number = 0; - private _cache: PrefixSumIndexOfResult[] | null = null; - - constructor(values: Uint32Array) { - this._actual = new PrefixSumComputer(values); - this._bustCache(); - } - - private _bustCache(): void { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - } - - public insertValues(insertIndex: number, insertValues: Uint32Array): void { - if (this._actual.insertValues(insertIndex, insertValues)) { - this._bustCache(); - } - } - - public changeValue(index: number, value: number): void { - if (this._actual.changeValue(index, value)) { - this._bustCache(); - } - } - - public removeValues(startIndex: number, cnt: number): void { - if (this._actual.removeValues(startIndex, cnt)) { - this._bustCache(); - } - } - - public getTotalValue(): number { - return this._actual.getTotalValue(); - } - - public getAccumulatedValue(index: number): number { - return this._actual.getAccumulatedValue(index); - } - - public getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult { - accumulatedValue = Math.floor(accumulatedValue); //@perf - - if (this._cache !== null) { - let cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; - if (cacheIndex >= 0 && cacheIndex < this._cache.length) { - // Cache hit! - return this._cache[cacheIndex]; - } - } - - // Cache miss! - return this._actual.getIndexOf(accumulatedValue); - } - - /** - * Gives a hint that a lot of requests are about to come in for these accumulated values. - */ - public warmUpCache(accumulatedValueStart: number, accumulatedValueEnd: number): void { - let newCache: PrefixSumIndexOfResult[] = []; - for (let accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { - newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); - } - this._cache = newCache; - this._cacheAccumulatedValueStart = accumulatedValueStart; - } -} diff --git a/src/vs/editor/common/viewModel/splitLinesCollection.ts b/src/vs/editor/common/viewModel/splitLinesCollection.ts index 3cd2afbafaf..dde0d12c37a 100644 --- a/src/vs/editor/common/viewModel/splitLinesCollection.ts +++ b/src/vs/editor/common/viewModel/splitLinesCollection.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as arrays from 'vs/base/common/arrays'; import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; import { LineTokens } from 'vs/editor/common/core/lineTokens'; import { Position } from 'vs/editor/common/core/position'; @@ -10,13 +11,13 @@ import { IRange, Range } from 'vs/editor/common/core/range'; import { EndOfLinePreference, IActiveIndentGuideInfo, IModelDecoration, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; import { ModelDecorationOptions, ModelDecorationOverviewRulerOptions } from 'vs/editor/common/model/textModel'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { PrefixSumComputerWithCache } from 'vs/editor/common/viewModel/prefixSumComputer'; +import { PrefixSumIndexOfResult } from 'vs/editor/common/viewModel/prefixSumComputer'; import { ICoordinatesConverter, IOverviewRulerDecorations, ViewLineData } from 'vs/editor/common/viewModel/viewModel'; import { ITheme } from 'vs/platform/theme/common/themeService'; import { IDisposable } from 'vs/base/common/lifecycle'; +import { FontInfo } from 'vs/editor/common/config/fontInfo'; export class OutputPosition { - _outputPositionBrand: void; outputLineIndex: number; outputOffset: number; @@ -26,15 +27,56 @@ export class OutputPosition { } } -export interface ILineMapping { - getOutputLineCount(): number; - getWrappedLinesIndent(): string; - getInputOffsetOfOutputPosition(outputLineIndex: number, outputOffset: number): number; - getOutputPositionOfInputOffset(inputOffset: number): OutputPosition; +export class LineBreakData { + constructor( + public breakOffsets: number[], + public breakOffsetsVisibleColumn: number[], + public wrappedTextIndentLength: number + ) { } + + public static getInputOffsetOfOutputPosition(breakOffsets: number[], outputLineIndex: number, outputOffset: number): number { + if (outputLineIndex === 0) { + return outputOffset; + } else { + return breakOffsets[outputLineIndex - 1] + outputOffset; + } + } + + public static getOutputPositionOfInputOffset(breakOffsets: number[], inputOffset: number): OutputPosition { + let low = 0; + let high = breakOffsets.length - 1; + let mid = 0; + let midStart = 0; + + while (low <= high) { + mid = low + ((high - low) / 2) | 0; + + const midStop = breakOffsets[mid]; + midStart = mid > 0 ? breakOffsets[mid - 1] : 0; + + if (inputOffset < midStart) { + high = mid - 1; + } else if (inputOffset >= midStop) { + low = mid + 1; + } else { + break; + } + } + + return new OutputPosition(mid, inputOffset - midStart); + } } -export interface ILineMapperFactory { - createLineMapping(lineText: string, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent): ILineMapping | null; +export interface ILineBreaksComputer { + /** + * Pass in `previousLineBreakData` if the only difference is in breaking columns!!! + */ + addRequest(lineText: string, previousLineBreakData: LineBreakData | null): void; + finalize(): (LineBreakData | null)[]; +} + +export interface ILineBreaksComputerFactory { + createLineBreaksComputer(fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent): ILineBreaksComputer; } export interface ISimpleModel { @@ -50,6 +92,7 @@ export interface ISplitLine { isVisible(): boolean; setVisible(isVisible: boolean): ISplitLine; + getLineBreakData(): LineBreakData | null; getViewLineCount(): number; getViewLineContent(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): string; getViewLineLength(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number; @@ -66,19 +109,19 @@ export interface ISplitLine { export interface IViewModelLinesCollection extends IDisposable { createCoordinatesConverter(): ICoordinatesConverter; - setWrappingSettings(wrappingIndent: WrappingIndent, wrappingColumn: number, columnsForFullWidthChar: number): boolean; + setWrappingSettings(fontInfo: FontInfo, wrappingAlgorithm: 'monospace' | 'dom', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean; setTabSize(newTabSize: number): boolean; getHiddenAreas(): Range[]; setHiddenAreas(_ranges: Range[]): boolean; + createLineBreaksComputer(): ILineBreaksComputer; onModelFlushed(): void; onModelLinesDeleted(versionId: number, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null; - onModelLinesInserted(versionId: number, fromLineNumber: number, toLineNumber: number, text: string[]): viewEvents.ViewLinesInsertedEvent | null; - onModelLineChanged(versionId: number, lineNumber: number, newText: string): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null]; + onModelLinesInserted(versionId: number, fromLineNumber: number, toLineNumber: number, lineBreaks: (LineBreakData | null)[]): viewEvents.ViewLinesInsertedEvent | null; + onModelLineChanged(versionId: number, lineNumber: number, lineBreakData: LineBreakData | null): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null]; acceptVersionId(versionId: number): void; getViewLineCount(): number; - warmUpLookupCache(viewStartLineNumber: number, viewEndLineNumber: number): void; getActiveIndentGuide(viewLineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo; getViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[]; getViewLineContent(viewLineNumber: number): string; @@ -107,9 +150,7 @@ export class CoordinatesConverter implements ICoordinatesConverter { } public convertViewRangeToModelRange(viewRange: Range): Range { - let start = this._lines.convertViewPositionToModelPosition(viewRange.startLineNumber, viewRange.startColumn); - let end = this._lines.convertViewPositionToModelPosition(viewRange.endLineNumber, viewRange.endColumn); - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + return this._lines.convertViewRangeToModelRange(viewRange); } public validateViewPosition(viewPosition: Position, expectedModelPosition: Position): Position { @@ -117,9 +158,7 @@ export class CoordinatesConverter implements ICoordinatesConverter { } public validateViewRange(viewRange: Range, expectedModelRange: Range): Range { - const validViewStart = this._lines.validateViewPosition(viewRange.startLineNumber, viewRange.startColumn, expectedModelRange.getStartPosition()); - const validViewEnd = this._lines.validateViewPosition(viewRange.endLineNumber, viewRange.endColumn, expectedModelRange.getEndPosition()); - return new Range(validViewStart.lineNumber, validViewStart.column, validViewEnd.lineNumber, validViewEnd.column); + return this._lines.validateViewRange(viewRange, expectedModelRange); } // Model -> View conversion and related methods @@ -135,7 +174,6 @@ export class CoordinatesConverter implements ICoordinatesConverter { public modelPositionIsVisible(modelPosition: Position): boolean { return this._lines.modelPositionIsVisible(modelPosition.lineNumber, modelPosition.column); } - } const enum IndentGuideRepeatOption { @@ -144,33 +182,129 @@ const enum IndentGuideRepeatOption { BlockAll = 2 } +class LineNumberMapper { + + private _counts: number[]; + private _isValid: boolean; + private _validEndIndex: number; + + private _modelToView: number[]; + private _viewToModel: number[]; + + constructor(viewLineCounts: number[]) { + this._counts = viewLineCounts; + this._isValid = false; + this._validEndIndex = -1; + this._modelToView = []; + this._viewToModel = []; + } + + private _invalidate(index: number): void { + this._isValid = false; + this._validEndIndex = Math.min(this._validEndIndex, index - 1); + } + + private _ensureValid(): void { + if (this._isValid) { + return; + } + + for (let i = this._validEndIndex + 1, len = this._counts.length; i < len; i++) { + const viewLineCount = this._counts[i]; + const viewLinesAbove = (i > 0 ? this._modelToView[i - 1] : 0); + + this._modelToView[i] = viewLinesAbove + viewLineCount; + for (let j = 0; j < viewLineCount; j++) { + this._viewToModel[viewLinesAbove + j] = i; + } + } + + // trim things + this._modelToView.length = this._counts.length; + this._viewToModel.length = this._modelToView[this._modelToView.length - 1]; + + // mark as valid + this._isValid = true; + this._validEndIndex = this._counts.length - 1; + } + + public changeValue(index: number, value: number): void { + if (this._counts[index] === value) { + // no change + return; + } + this._counts[index] = value; + this._invalidate(index); + } + + public removeValues(start: number, deleteCount: number): void { + this._counts.splice(start, deleteCount); + this._invalidate(start); + } + + public insertValues(insertIndex: number, insertArr: number[]): void { + this._counts = arrays.arrayInsert(this._counts, insertIndex, insertArr); + this._invalidate(insertIndex); + } + + public getTotalValue(): number { + this._ensureValid(); + return this._viewToModel.length; + } + + public getAccumulatedValue(index: number): number { + this._ensureValid(); + return this._modelToView[index]; + } + + public getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult { + this._ensureValid(); + const modelLineIndex = this._viewToModel[accumulatedValue]; + const viewLinesAbove = (modelLineIndex > 0 ? this._modelToView[modelLineIndex - 1] : 0); + return new PrefixSumIndexOfResult(modelLineIndex, accumulatedValue - viewLinesAbove); + } +} + export class SplitLinesCollection implements IViewModelLinesCollection { private readonly model: ITextModel; private _validModelVersionId: number; - private wrappingColumn: number; - private columnsForFullWidthChar: number; - private wrappingIndent: WrappingIndent; + private readonly _domLineBreaksComputerFactory: ILineBreaksComputerFactory; + private readonly _monospaceLineBreaksComputerFactory: ILineBreaksComputerFactory; + + private fontInfo: FontInfo; private tabSize: number; + private wrappingColumn: number; + private wrappingIndent: WrappingIndent; + private wrappingAlgorithm: 'monospace' | 'dom'; private lines!: ISplitLine[]; - private prefixSumComputer!: PrefixSumComputerWithCache; - - private readonly linePositionMapperFactory: ILineMapperFactory; + private prefixSumComputer!: LineNumberMapper; private hiddenAreasIds!: string[]; - constructor(model: ITextModel, linePositionMapperFactory: ILineMapperFactory, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent) { + constructor( + model: ITextModel, + domLineBreaksComputerFactory: ILineBreaksComputerFactory, + monospaceLineBreaksComputerFactory: ILineBreaksComputerFactory, + fontInfo: FontInfo, + tabSize: number, + wrappingAlgorithm: 'monospace' | 'dom', + wrappingColumn: number, + wrappingIndent: WrappingIndent, + ) { this.model = model; this._validModelVersionId = -1; + this._domLineBreaksComputerFactory = domLineBreaksComputerFactory; + this._monospaceLineBreaksComputerFactory = monospaceLineBreaksComputerFactory; + this.fontInfo = fontInfo; this.tabSize = tabSize; + this.wrappingAlgorithm = wrappingAlgorithm; this.wrappingColumn = wrappingColumn; - this.columnsForFullWidthChar = columnsForFullWidthChar; this.wrappingIndent = wrappingIndent; - this.linePositionMapperFactory = linePositionMapperFactory; - this._constructLines(true); + this._constructLines(/*resetHiddenAreas*/true, null); } public dispose(): void { @@ -181,19 +315,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection { return new CoordinatesConverter(this); } - private _ensureValidState(): void { - let modelVersion = this.model.getVersionId(); - if (modelVersion !== this._validModelVersionId) { - // This is pretty bad, it means we lost track of the model... - throw new Error(`ViewModel is out of sync with Model!`); - } - if (this.lines.length !== this.model.getLineCount()) { - // This is pretty bad, it means we lost track of the model... - this._constructLines(false); - } - } - - private _constructLines(resetHiddenAreas: boolean): void { + private _constructLines(resetHiddenAreas: boolean, previousLineBreaks: ((LineBreakData | null)[]) | null): void { this.lines = []; if (resetHiddenAreas) { @@ -201,8 +323,14 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } let linesContent = this.model.getLinesContent(); - let lineCount = linesContent.length; - let values = new Uint32Array(lineCount); + const lineCount = linesContent.length; + const lineBreaksComputer = this.createLineBreaksComputer(); + for (let i = 0; i < lineCount; i++) { + lineBreaksComputer.addRequest(linesContent[i], previousLineBreaks ? previousLineBreaks[i] : null); + } + const linesBreaks = lineBreaksComputer.finalize(); + + let values: number[] = []; let hiddenAreas = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)!).sort(Range.compareRangesUsingStarts); let hiddenAreaStart = 1, hiddenAreaEnd = 0; @@ -220,14 +348,14 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } let isInHiddenArea = (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd); - let line = createSplitLine(this.linePositionMapperFactory, linesContent[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea); + let line = createSplitLine(linesBreaks[i], !isInHiddenArea); values[i] = line.getViewLineCount(); this.lines[i] = line; } this._validModelVersionId = this.model.getVersionId(); - this.prefixSumComputer = new PrefixSumComputerWithCache(values); + this.prefixSumComputer = new LineNumberMapper(values); } public getHiddenAreas(): Range[] { @@ -351,27 +479,51 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } this.tabSize = newTabSize; - this._constructLines(false); + this._constructLines(/*resetHiddenAreas*/false, null); return true; } - public setWrappingSettings(wrappingIndent: WrappingIndent, wrappingColumn: number, columnsForFullWidthChar: number): boolean { - if (this.wrappingIndent === wrappingIndent && this.wrappingColumn === wrappingColumn && this.columnsForFullWidthChar === columnsForFullWidthChar) { + public setWrappingSettings(fontInfo: FontInfo, wrappingAlgorithm: 'monospace' | 'dom', wrappingColumn: number, wrappingIndent: WrappingIndent): boolean { + const equalFontInfo = this.fontInfo.equals(fontInfo); + const equalWrappingAlgorithm = (this.wrappingAlgorithm === wrappingAlgorithm); + const equalWrappingColumn = (this.wrappingColumn === wrappingColumn); + const equalWrappingIndent = (this.wrappingIndent === wrappingIndent); + if (equalFontInfo && equalWrappingAlgorithm && equalWrappingColumn && equalWrappingIndent) { return false; } - this.wrappingIndent = wrappingIndent; - this.wrappingColumn = wrappingColumn; - this.columnsForFullWidthChar = columnsForFullWidthChar; + const onlyWrappingColumnChanged = (equalFontInfo && equalWrappingAlgorithm && !equalWrappingColumn && equalWrappingIndent); - this._constructLines(false); + this.fontInfo = fontInfo; + this.wrappingAlgorithm = wrappingAlgorithm; + this.wrappingColumn = wrappingColumn; + this.wrappingIndent = wrappingIndent; + + let previousLineBreaks: ((LineBreakData | null)[]) | null = null; + if (onlyWrappingColumnChanged) { + previousLineBreaks = []; + for (let i = 0, len = this.lines.length; i < len; i++) { + previousLineBreaks[i] = this.lines[i].getLineBreakData(); + } + } + + this._constructLines(/*resetHiddenAreas*/false, previousLineBreaks); return true; } + public createLineBreaksComputer(): ILineBreaksComputer { + const lineBreaksComputerFactory = ( + this.wrappingAlgorithm === 'dom' + ? this._domLineBreaksComputerFactory + : this._monospaceLineBreaksComputerFactory + ); + return lineBreaksComputerFactory.createLineBreaksComputer(this.fontInfo, this.tabSize, this.wrappingColumn, this.wrappingIndent); + } + public onModelFlushed(): void { - this._constructLines(true); + this._constructLines(/*resetHiddenAreas*/true, null); } public onModelLinesDeleted(versionId: number, fromLineNumber: number, toLineNumber: number): viewEvents.ViewLinesDeletedEvent | null { @@ -390,7 +542,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection { return new viewEvents.ViewLinesDeletedEvent(outputFromLineNumber, outputToLineNumber); } - public onModelLinesInserted(versionId: number, fromLineNumber: number, _toLineNumber: number, text: string[]): viewEvents.ViewLinesInsertedEvent | null { + public onModelLinesInserted(versionId: number, fromLineNumber: number, _toLineNumber: number, lineBreaks: (LineBreakData | null)[]): viewEvents.ViewLinesInsertedEvent | null { if (versionId <= this._validModelVersionId) { // Here we check for versionId in case the lines were reconstructed in the meantime. // We don't want to apply stale change events on top of a newer read model state. @@ -411,10 +563,10 @@ export class SplitLinesCollection implements IViewModelLinesCollection { let totalOutputLineCount = 0; let insertLines: ISplitLine[] = []; - let insertPrefixSumValues = new Uint32Array(text.length); + let insertPrefixSumValues: number[] = []; - for (let i = 0, len = text.length; i < len; i++) { - let line = createSplitLine(this.linePositionMapperFactory, text[i], this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, !isInHiddenArea); + for (let i = 0, len = lineBreaks.length; i < len; i++) { + let line = createSplitLine(lineBreaks[i], !isInHiddenArea); insertLines.push(line); let outputLineCount = line.getViewLineCount(); @@ -430,7 +582,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection { return new viewEvents.ViewLinesInsertedEvent(outputFromLineNumber, outputFromLineNumber + totalOutputLineCount - 1); } - public onModelLineChanged(versionId: number, lineNumber: number, newText: string): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null] { + public onModelLineChanged(versionId: number, lineNumber: number, lineBreakData: LineBreakData | null): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null] { if (versionId <= this._validModelVersionId) { // Here we check for versionId in case the lines were reconstructed in the meantime. // We don't want to apply stale change events on top of a newer read model state. @@ -441,7 +593,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection { let oldOutputLineCount = this.lines[lineIndex].getViewLineCount(); let isVisible = this.lines[lineIndex].isVisible(); - let line = createSplitLine(this.linePositionMapperFactory, newText, this.tabSize, this.wrappingColumn, this.columnsForFullWidthChar, this.wrappingIndent, isVisible); + let line = createSplitLine(lineBreakData, isVisible); this.lines[lineIndex] = line; let newOutputLineCount = this.lines[lineIndex].getViewLineCount(); @@ -488,7 +640,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLineCount(): number { - this._ensureValidState(); return this.prefixSumComputer.getTotalValue(); } @@ -496,22 +647,14 @@ export class SplitLinesCollection implements IViewModelLinesCollection { if (viewLineNumber < 1) { return 1; } - let viewLineCount = this.getViewLineCount(); + const viewLineCount = this.getViewLineCount(); if (viewLineNumber > viewLineCount) { return viewLineCount; } - return viewLineNumber; - } - - /** - * Gives a hint that a lot of requests are about to come in for these line numbers. - */ - public warmUpLookupCache(viewStartLineNumber: number, viewEndLineNumber: number): void { - this.prefixSumComputer.warmUpCache(viewStartLineNumber - 1, viewEndLineNumber - 1); + return viewLineNumber | 0; } public getActiveIndentGuide(viewLineNumber: number, minLineNumber: number, maxLineNumber: number): IActiveIndentGuideInfo { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); minLineNumber = this._toValidViewLineNumber(minLineNumber); maxLineNumber = this._toValidViewLineNumber(maxLineNumber); @@ -531,7 +674,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLinesIndentGuides(viewStartLineNumber: number, viewEndLineNumber: number): number[] { - this._ensureValidState(); viewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber); viewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber); @@ -602,7 +744,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLineContent(viewLineNumber: number): string { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); let lineIndex = r.index; @@ -612,7 +753,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLineLength(viewLineNumber: number): number { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); let lineIndex = r.index; @@ -622,7 +762,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLineMinColumn(viewLineNumber: number): number { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); let lineIndex = r.index; @@ -632,7 +771,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLineMaxColumn(viewLineNumber: number): number { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); let lineIndex = r.index; @@ -642,7 +780,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLineData(viewLineNumber: number): ViewLineData { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); let lineIndex = r.index; @@ -652,7 +789,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public getViewLinesData(viewStartLineNumber: number, viewEndLineNumber: number, needed: boolean[]): ViewLineData[] { - this._ensureValidState(); viewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber); viewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber); @@ -691,7 +827,6 @@ export class SplitLinesCollection implements IViewModelLinesCollection { } public validateViewPosition(viewLineNumber: number, viewColumn: number, expectedModelPosition: Position): Position { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); @@ -719,8 +854,13 @@ export class SplitLinesCollection implements IViewModelLinesCollection { return this.convertModelPositionToViewPosition(expectedModelPosition.lineNumber, expectedModelPosition.column); } + public validateViewRange(viewRange: Range, expectedModelRange: Range): Range { + const validViewStart = this.validateViewPosition(viewRange.startLineNumber, viewRange.startColumn, expectedModelRange.getStartPosition()); + const validViewEnd = this.validateViewPosition(viewRange.endLineNumber, viewRange.endColumn, expectedModelRange.getEndPosition()); + return new Range(validViewStart.lineNumber, validViewStart.column, validViewEnd.lineNumber, validViewEnd.column); + } + public convertViewPositionToModelPosition(viewLineNumber: number, viewColumn: number): Position { - this._ensureValidState(); viewLineNumber = this._toValidViewLineNumber(viewLineNumber); let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); @@ -732,8 +872,13 @@ export class SplitLinesCollection implements IViewModelLinesCollection { return this.model.validatePosition(new Position(lineIndex + 1, inputColumn)); } + public convertViewRangeToModelRange(viewRange: Range): Range { + const start = this.convertViewPositionToModelPosition(viewRange.startLineNumber, viewRange.startColumn); + const end = this.convertViewPositionToModelPosition(viewRange.endLineNumber, viewRange.endColumn); + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + } + public convertModelPositionToViewPosition(_modelLineNumber: number, _modelColumn: number): Position { - this._ensureValidState(); const validPosition = this.model.validatePosition(new Position(_modelLineNumber, _modelColumn)); const inputLineNumber = validPosition.lineNumber; @@ -898,6 +1043,10 @@ class VisibleIdentitySplitLine implements ISplitLine { return InvisibleIdentitySplitLine.INSTANCE; } + public getLineBreakData(): LineBreakData | null { + return null; + } + public getViewLineCount(): number { return 1; } @@ -926,6 +1075,7 @@ class VisibleIdentitySplitLine implements ISplitLine { false, 1, lineContent.length + 1, + 0, lineTokens.inflate() ); } @@ -968,6 +1118,10 @@ class InvisibleIdentitySplitLine implements ISplitLine { return VisibleIdentitySplitLine.INSTANCE; } + public getLineBreakData(): LineBreakData | null { + return null; + } + public getViewLineCount(): number { return 0; } @@ -1011,18 +1165,11 @@ class InvisibleIdentitySplitLine implements ISplitLine { export class SplitLine implements ISplitLine { - private readonly positionMapper: ILineMapping; - private readonly outputLineCount: number; - - private readonly wrappedIndent: string; - private readonly wrappedIndentLength: number; + private readonly _lineBreakData: LineBreakData; private _isVisible: boolean; - constructor(positionMapper: ILineMapping, isVisible: boolean) { - this.positionMapper = positionMapper; - this.wrappedIndent = this.positionMapper.getWrappedLinesIndent(); - this.wrappedIndentLength = this.wrappedIndent.length; - this.outputLineCount = this.positionMapper.getOutputLineCount(); + constructor(lineBreakData: LineBreakData, isVisible: boolean) { + this._lineBreakData = lineBreakData; this._isVisible = isVisible; } @@ -1035,22 +1182,26 @@ export class SplitLine implements ISplitLine { return this; } + public getLineBreakData(): LineBreakData | null { + return this._lineBreakData; + } + public getViewLineCount(): number { if (!this._isVisible) { return 0; } - return this.outputLineCount; + return this._lineBreakData.breakOffsets.length; } private getInputStartOffsetOfOutputLineIndex(outputLineIndex: number): number { - return this.positionMapper.getInputOffsetOfOutputPosition(outputLineIndex, 0); + return LineBreakData.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets, outputLineIndex, 0); } private getInputEndOffsetOfOutputLineIndex(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): number { - if (outputLineIndex + 1 === this.outputLineCount) { + if (outputLineIndex + 1 === this._lineBreakData.breakOffsets.length) { return model.getLineMaxColumn(modelLineNumber) - 1; } - return this.positionMapper.getInputOffsetOfOutputPosition(outputLineIndex + 1, 0); + return LineBreakData.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets, outputLineIndex + 1, 0); } public getViewLineContent(model: ISimpleModel, modelLineNumber: number, outputLineIndex: number): string { @@ -1067,7 +1218,7 @@ export class SplitLine implements ISplitLine { }); if (outputLineIndex > 0) { - r = this.wrappedIndent + r; + r = spaces(this._lineBreakData.wrappedTextIndentLength) + r; } return r; @@ -1082,7 +1233,7 @@ export class SplitLine implements ISplitLine { let r = endOffset - startOffset; if (outputLineIndex > 0) { - r = this.wrappedIndent.length + r; + r = this._lineBreakData.wrappedTextIndentLength + r; } return r; @@ -1093,7 +1244,7 @@ export class SplitLine implements ISplitLine { throw new Error('Not supported'); } if (outputLineIndex > 0) { - return this.wrappedIndentLength + 1; + return this._lineBreakData.wrappedTextIndentLength + 1; } return 1; } @@ -1121,25 +1272,28 @@ export class SplitLine implements ISplitLine { }); if (outputLineIndex > 0) { - lineContent = this.wrappedIndent + lineContent; + lineContent = spaces(this._lineBreakData.wrappedTextIndentLength) + lineContent; } - let minColumn = (outputLineIndex > 0 ? this.wrappedIndentLength + 1 : 1); + let minColumn = (outputLineIndex > 0 ? this._lineBreakData.wrappedTextIndentLength + 1 : 1); let maxColumn = lineContent.length + 1; let continuesWithWrappedLine = (outputLineIndex + 1 < this.getViewLineCount()); let deltaStartIndex = 0; if (outputLineIndex > 0) { - deltaStartIndex = this.wrappedIndentLength; + deltaStartIndex = this._lineBreakData.wrappedTextIndentLength; } let lineTokens = model.getLineTokens(modelLineNumber); + const startVisibleColumn = (outputLineIndex === 0 ? 0 : this._lineBreakData.breakOffsetsVisibleColumn[outputLineIndex - 1]); + return new ViewLineData( lineContent, continuesWithWrappedLine, minColumn, maxColumn, + startVisibleColumn, lineTokens.sliceAndInflate(startOffset, endOffset, deltaStartIndex) ); } @@ -1165,25 +1319,25 @@ export class SplitLine implements ISplitLine { } let adjustedColumn = outputColumn - 1; if (outputLineIndex > 0) { - if (adjustedColumn < this.wrappedIndentLength) { + if (adjustedColumn < this._lineBreakData.wrappedTextIndentLength) { adjustedColumn = 0; } else { - adjustedColumn -= this.wrappedIndentLength; + adjustedColumn -= this._lineBreakData.wrappedTextIndentLength; } } - return this.positionMapper.getInputOffsetOfOutputPosition(outputLineIndex, adjustedColumn) + 1; + return LineBreakData.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets, outputLineIndex, adjustedColumn) + 1; } public getViewPositionOfModelPosition(deltaLineNumber: number, inputColumn: number): Position { if (!this._isVisible) { throw new Error('Not supported'); } - let r = this.positionMapper.getOutputPositionOfInputOffset(inputColumn - 1); + let r = LineBreakData.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets, inputColumn - 1); let outputLineIndex = r.outputLineIndex; let outputColumn = r.outputOffset + 1; if (outputLineIndex > 0) { - outputColumn += this.wrappedIndentLength; + outputColumn += this._lineBreakData.wrappedTextIndentLength; } // console.log('in -> out ' + deltaLineNumber + ',' + inputColumn + ' ===> ' + (deltaLineNumber+outputLineIndex) + ',' + outputColumn); @@ -1194,21 +1348,33 @@ export class SplitLine implements ISplitLine { if (!this._isVisible) { throw new Error('Not supported'); } - const r = this.positionMapper.getOutputPositionOfInputOffset(inputColumn - 1); + const r = LineBreakData.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets, inputColumn - 1); return (deltaLineNumber + r.outputLineIndex); } } -function createSplitLine(linePositionMapperFactory: ILineMapperFactory, text: string, tabSize: number, wrappingColumn: number, columnsForFullWidthChar: number, wrappingIndent: WrappingIndent, isVisible: boolean): ISplitLine { - let positionMapper = linePositionMapperFactory.createLineMapping(text, tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent); - if (positionMapper === null) { +let _spaces: string[] = ['']; +function spaces(count: number): string { + if (count >= _spaces.length) { + for (let i = 1; i <= count; i++) { + _spaces[i] = _makeSpaces(i); + } + } + return _spaces[count]; +} +function _makeSpaces(count: number): string { + return new Array(count + 1).join(' '); +} + +function createSplitLine(lineBreakData: LineBreakData | null, isVisible: boolean): ISplitLine { + if (lineBreakData === null) { // No mapping needed if (isVisible) { return VisibleIdentitySplitLine.INSTANCE; } return InvisibleIdentitySplitLine.INSTANCE; } else { - return new SplitLine(positionMapper, isVisible); + return new SplitLine(lineBreakData, isVisible); } } @@ -1294,10 +1460,22 @@ export class IdentityLinesCollection implements IViewModelLinesCollection { return false; } - public setWrappingSettings(_wrappingIndent: WrappingIndent, _wrappingColumn: number, _columnsForFullWidthChar: number): boolean { + public setWrappingSettings(_fontInfo: FontInfo, _wrappingAlgorithm: 'monospace' | 'dom', _wrappingColumn: number, _wrappingIndent: WrappingIndent): boolean { return false; } + public createLineBreaksComputer(): ILineBreaksComputer { + let result: null[] = []; + return { + addRequest: (lineText: string, previousLineBreakData: LineBreakData | null) => { + result.push(null); + }, + finalize: () => { + return result; + } + }; + } + public onModelFlushed(): void { } @@ -1305,11 +1483,11 @@ export class IdentityLinesCollection implements IViewModelLinesCollection { return new viewEvents.ViewLinesDeletedEvent(fromLineNumber, toLineNumber); } - public onModelLinesInserted(_versionId: number, fromLineNumber: number, toLineNumber: number, _text: string[]): viewEvents.ViewLinesInsertedEvent | null { + public onModelLinesInserted(_versionId: number, fromLineNumber: number, toLineNumber: number, lineBreaks: (LineBreakData | null)[]): viewEvents.ViewLinesInsertedEvent | null { return new viewEvents.ViewLinesInsertedEvent(fromLineNumber, toLineNumber); } - public onModelLineChanged(_versionId: number, lineNumber: number, _newText: string): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null] { + public onModelLineChanged(_versionId: number, lineNumber: number, lineBreakData: LineBreakData | null): [boolean, viewEvents.ViewLinesChangedEvent | null, viewEvents.ViewLinesInsertedEvent | null, viewEvents.ViewLinesDeletedEvent | null] { return [false, new viewEvents.ViewLinesChangedEvent(lineNumber, lineNumber), null, null]; } @@ -1320,9 +1498,6 @@ export class IdentityLinesCollection implements IViewModelLinesCollection { return this.model.getLineCount(); } - public warmUpLookupCache(_viewStartLineNumber: number, _viewEndLineNumber: number): void { - } - public getActiveIndentGuide(viewLineNumber: number, _minLineNumber: number, _maxLineNumber: number): IActiveIndentGuideInfo { return { startLineNumber: viewLineNumber, @@ -1364,6 +1539,7 @@ export class IdentityLinesCollection implements IViewModelLinesCollection { false, 1, lineContent.length + 1, + 0, lineTokens.inflate() ); } diff --git a/src/vs/editor/common/viewModel/viewEventHandler.ts b/src/vs/editor/common/viewModel/viewEventHandler.ts index e421f5ffde2..b8d0bc823a6 100644 --- a/src/vs/editor/common/viewModel/viewEventHandler.ts +++ b/src/vs/editor/common/viewModel/viewEventHandler.ts @@ -36,6 +36,9 @@ export class ViewEventHandler extends Disposable { public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { return false; } + public onContentSizeChanged(e: viewEvents.ViewContentSizeChangedEvent): boolean { + return false; + } public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { return false; } @@ -69,6 +72,9 @@ export class ViewEventHandler extends Disposable { public onScrollChanged(e: viewEvents.ViewScrollChangedEvent): boolean { return false; } + public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean { + return false; + } public onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean { return false; } @@ -78,9 +84,6 @@ export class ViewEventHandler extends Disposable { public onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean { return false; } - public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean { - return false; - } // --- end event handlers @@ -99,6 +102,12 @@ export class ViewEventHandler extends Disposable { } break; + case viewEvents.ViewEventType.ViewContentSizeChanged: + if (this.onContentSizeChanged(e)) { + shouldRender = true; + } + break; + case viewEvents.ViewEventType.ViewCursorStateChanged: if (this.onCursorStateChanged(e)) { shouldRender = true; @@ -171,6 +180,12 @@ export class ViewEventHandler extends Disposable { } break; + case viewEvents.ViewEventType.ViewThemeChanged: + if (this.onThemeChanged(e)) { + shouldRender = true; + } + break; + case viewEvents.ViewEventType.ViewTokensColorsChanged: if (this.onTokensColorsChanged(e)) { shouldRender = true; @@ -183,12 +198,6 @@ export class ViewEventHandler extends Disposable { } break; - case viewEvents.ViewEventType.ViewThemeChanged: - if (this.onThemeChanged(e)) { - shouldRender = true; - } - break; - default: console.info('View received unknown event: '); console.info(e); diff --git a/src/vs/editor/common/viewModel/viewModel.ts b/src/vs/editor/common/viewModel/viewModel.ts index a3abd74ee4e..145d770e7d6 100644 --- a/src/vs/editor/common/viewModel/viewModel.ts +++ b/src/vs/editor/common/viewModel/viewModel.ts @@ -41,7 +41,7 @@ export class Viewport { export interface IViewLayout { - readonly scrollable: Scrollable; + getScrollable(): Scrollable; onMaxLineWidthChanged(width: number): void; @@ -138,8 +138,8 @@ export interface IViewModel { deduceModelPositionRelativeToViewPosition(viewAnchorPosition: Position, deltaOffset: number, lineFeedCnt: number): Position; getEOL(): string; - getPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[]; - getHTMLToCopy(ranges: Range[], emptySelectionClipboard: boolean): string | null; + getPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[]; + getRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string, mode: string } | null; } export class MinimapLinesRenderingData { @@ -174,6 +174,10 @@ export class ViewLineData { * The maximum allowed column at this view line. */ public readonly maxColumn: number; + /** + * The visible column at the start of the line (after the fauxIndent). + */ + public readonly startVisibleColumn: number; /** * The tokens at this view line. */ @@ -184,12 +188,14 @@ export class ViewLineData { continuesWithWrappedLine: boolean, minColumn: number, maxColumn: number, + startVisibleColumn: number, tokens: IViewLineTokens ) { this.content = content; this.continuesWithWrappedLine = continuesWithWrappedLine; this.minColumn = minColumn; this.maxColumn = maxColumn; + this.startVisibleColumn = startVisibleColumn; this.tokens = tokens; } } @@ -231,6 +237,10 @@ export class ViewLineRenderingData { * The tab size for this view model. */ public readonly tabSize: number; + /** + * The visible column at the start of the line (after the fauxIndent) + */ + public readonly startVisibleColumn: number; constructor( minColumn: number, @@ -241,7 +251,8 @@ export class ViewLineRenderingData { mightContainNonBasicASCII: boolean, tokens: IViewLineTokens, inlineDecorations: InlineDecoration[], - tabSize: number + tabSize: number, + startVisibleColumn: number ) { this.minColumn = minColumn; this.maxColumn = maxColumn; @@ -254,6 +265,7 @@ export class ViewLineRenderingData { this.tokens = tokens; this.inlineDecorations = inlineDecorations; this.tabSize = tabSize; + this.startVisibleColumn = startVisibleColumn; } public static isBasicASCII(lineContent: string, mightContainNonBasicASCII: boolean): boolean { diff --git a/src/vs/editor/common/viewModel/viewModelDecorations.ts b/src/vs/editor/common/viewModel/viewModelDecorations.ts index b74baa8dd1c..c30da7ecdf4 100644 --- a/src/vs/editor/common/viewModel/viewModelDecorations.ts +++ b/src/vs/editor/common/viewModel/viewModelDecorations.ts @@ -10,7 +10,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon'; import { IModelDecoration, ITextModel } from 'vs/editor/common/model'; import { IViewModelLinesCollection } from 'vs/editor/common/viewModel/splitLinesCollection'; import { ICoordinatesConverter, InlineDecoration, InlineDecorationType, ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel'; -import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import { filterValidationDecorations } from 'vs/editor/common/config/editorOptions'; export interface IDecorationsViewportData { /** @@ -104,7 +104,7 @@ export class ViewModelDecorations implements IDisposable { } private _getDecorationsViewportData(viewportRange: Range): IDecorationsViewportData { - const modelDecorations = this._linesCollection.getDecorationsInRange(viewportRange, this.editorId, this.configuration.options.get(EditorOption.readOnly)); + const modelDecorations = this._linesCollection.getDecorationsInRange(viewportRange, this.editorId, filterValidationDecorations(this.configuration.options)); const startLineNumber = viewportRange.startLineNumber; const endLineNumber = viewportRange.endLineNumber; diff --git a/src/vs/editor/common/viewModel/viewModelImpl.ts b/src/vs/editor/common/viewModel/viewModelImpl.ts index e08af64ebf9..aee611b762d 100644 --- a/src/vs/editor/common/viewModel/viewModelImpl.ts +++ b/src/vs/editor/common/viewModel/viewModelImpl.ts @@ -6,10 +6,10 @@ import { Color } from 'vs/base/common/color'; import { IDisposable } from 'vs/base/common/lifecycle'; import * as strings from 'vs/base/common/strings'; -import { ConfigurationChangedEvent, EDITOR_FONT_DEFAULTS, EditorOption } from 'vs/editor/common/config/editorOptions'; +import { ConfigurationChangedEvent, EDITOR_FONT_DEFAULTS, EditorOption, filterValidationDecorations } 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 * as editorCommon from 'vs/editor/common/editorCommon'; +import { IConfiguration, IViewState } from 'vs/editor/common/editorCommon'; import { EndOfLinePreference, IActiveIndentGuideInfo, ITextModel, TrackedRangeStickiness, TextModelResolvedOptions } from 'vs/editor/common/model'; import { ModelDecorationOverviewRulerOptions, ModelDecorationMinimapOptions } from 'vs/editor/common/model/textModel'; import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; @@ -18,8 +18,7 @@ import { tokenizeLineToHTML } from 'vs/editor/common/modes/textToHtmlTokenizer'; import { MinimapTokensColorTracker } from 'vs/editor/common/viewModel/minimapTokensColorTracker'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { ViewLayout } from 'vs/editor/common/viewLayout/viewLayout'; -import { CharacterHardWrappingLineMapperFactory } from 'vs/editor/common/viewModel/characterHardWrappingLineMapper'; -import { IViewModelLinesCollection, IdentityLinesCollection, SplitLinesCollection } from 'vs/editor/common/viewModel/splitLinesCollection'; +import { IViewModelLinesCollection, IdentityLinesCollection, SplitLinesCollection, ILineBreaksComputerFactory } from 'vs/editor/common/viewModel/splitLinesCollection'; import { ICoordinatesConverter, IOverviewRulerDecorations, IViewModel, MinimapLinesRenderingData, ViewLineData, ViewLineRenderingData, ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel'; import { ViewModelDecorations } from 'vs/editor/common/viewModel/viewModelDecorations'; import { ITheme } from 'vs/platform/theme/common/themeService'; @@ -31,7 +30,7 @@ const USE_IDENTITY_LINES_COLLECTION = true; export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel { private readonly editorId: number; - private readonly configuration: editorCommon.IConfiguration; + private readonly configuration: IConfiguration; private readonly model: ITextModel; private readonly _tokenizeViewportSoon: RunOnceScheduler; private hasFocus: boolean; @@ -43,7 +42,14 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel public readonly viewLayout: ViewLayout; private readonly decorations: ViewModelDecorations; - constructor(editorId: number, configuration: editorCommon.IConfiguration, model: ITextModel, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) { + constructor( + editorId: number, + configuration: IConfiguration, + model: ITextModel, + domLineBreaksComputerFactory: ILineBreaksComputerFactory, + monospaceLineBreaksComputerFactory: ILineBreaksComputerFactory, + scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable + ) { super(); this.editorId = editorId; @@ -61,25 +67,19 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel } else { const options = this.configuration.options; - const wrappingInfo = options.get(EditorOption.wrappingInfo); const fontInfo = options.get(EditorOption.fontInfo); - const wordWrapBreakAfterCharacters = options.get(EditorOption.wordWrapBreakAfterCharacters); - const wordWrapBreakBeforeCharacters = options.get(EditorOption.wordWrapBreakBeforeCharacters); - const wordWrapBreakObtrusiveCharacters = options.get(EditorOption.wordWrapBreakObtrusiveCharacters); + const wrappingAlgorithm = options.get(EditorOption.wrappingAlgorithm); + const wrappingInfo = options.get(EditorOption.wrappingInfo); const wrappingIndent = options.get(EditorOption.wrappingIndent); - let hardWrappingLineMapperFactory = new CharacterHardWrappingLineMapperFactory( - wordWrapBreakBeforeCharacters, - wordWrapBreakAfterCharacters, - wordWrapBreakObtrusiveCharacters - ); - this.lines = new SplitLinesCollection( this.model, - hardWrappingLineMapperFactory, + domLineBreaksComputerFactory, + monospaceLineBreaksComputerFactory, + fontInfo, this.model.getOptions().tabSize, + wrappingAlgorithm, wrappingInfo.wrappingColumn, - fontInfo.typicalFullwidthCharacterWidth / fontInfo.typicalHalfwidthCharacterWidth, wrappingIndent ); } @@ -100,6 +100,15 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel } })); + this._register(this.viewLayout.onDidContentSizeChange((e) => { + try { + const eventsCollector = this._beginEmit(); + eventsCollector.emit(new viewEvents.ViewContentSizeChangedEvent(e)); + } finally { + this._endEmit(); + } + })); + this.decorations = new ViewModelDecorations(this.editorId, this.model, this.configuration, this.lines, this.coordinatesConverter); this._registerModelEvents(); @@ -155,11 +164,12 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel let restorePreviousViewportStart = false; const options = this.configuration.options; - const wrappingInfo = options.get(EditorOption.wrappingInfo); const fontInfo = options.get(EditorOption.fontInfo); + const wrappingAlgorithm = options.get(EditorOption.wrappingAlgorithm); + const wrappingInfo = options.get(EditorOption.wrappingInfo); const wrappingIndent = options.get(EditorOption.wrappingIndent); - if (this.lines.setWrappingSettings(wrappingIndent, wrappingInfo.wrappingColumn, fontInfo.typicalFullwidthCharacterWidth / fontInfo.typicalHalfwidthCharacterWidth)) { + if (this.lines.setWrappingSettings(fontInfo, wrappingAlgorithm, wrappingInfo.wrappingColumn, wrappingIndent)) { eventsCollector.emit(new viewEvents.ViewFlushedEvent()); eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent()); eventsCollector.emit(new viewEvents.ViewDecorationsChangedEvent()); @@ -200,8 +210,26 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel const changes = e.changes; const versionId = e.versionId; - for (let j = 0, lenJ = changes.length; j < lenJ; j++) { - const change = changes[j]; + // Do a first pass to compute line mappings, and a second pass to actually interpret them + const lineBreaksComputer = this.lines.createLineBreaksComputer(); + for (const change of changes) { + switch (change.changeType) { + case textModelEvents.RawContentChangedType.LinesInserted: { + for (const line of change.detail) { + lineBreaksComputer.addRequest(line, null); + } + break; + } + case textModelEvents.RawContentChangedType.LineChanged: { + lineBreaksComputer.addRequest(change.detail, null); + break; + } + } + } + const lineBreaks = lineBreaksComputer.finalize(); + let lineBreaksOffset = 0; + + for (const change of changes) { switch (change.changeType) { case textModelEvents.RawContentChangedType.Flush: { @@ -222,7 +250,10 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel break; } case textModelEvents.RawContentChangedType.LinesInserted: { - const linesInsertedEvent = this.lines.onModelLinesInserted(versionId, change.fromLineNumber, change.toLineNumber, change.detail); + const insertedLineBreaks = lineBreaks.slice(lineBreaksOffset, lineBreaksOffset + change.detail.length); + lineBreaksOffset += change.detail.length; + + const linesInsertedEvent = this.lines.onModelLinesInserted(versionId, change.fromLineNumber, change.toLineNumber, insertedLineBreaks); if (linesInsertedEvent !== null) { eventsCollector.emit(linesInsertedEvent); this.viewLayout.onLinesInserted(linesInsertedEvent.fromLineNumber, linesInsertedEvent.toLineNumber); @@ -231,7 +262,10 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel break; } case textModelEvents.RawContentChangedType.LineChanged: { - const [lineMappingChanged, linesChangedEvent, linesInsertedEvent, linesDeletedEvent] = this.lines.onModelLineChanged(versionId, change.lineNumber, change.detail); + const changedLineBreakData = lineBreaks[lineBreaksOffset]; + lineBreaksOffset++; + + const [lineMappingChanged, linesChangedEvent, linesInsertedEvent, linesDeletedEvent] = this.lines.onModelLineChanged(versionId, change.lineNumber, changedLineBreakData); hadModelLineChangeThatChangedLineMapping = lineMappingChanged; if (linesChangedEvent) { eventsCollector.emit(linesChangedEvent); @@ -422,7 +456,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel ); } - public saveState(): editorCommon.IViewState { + public saveState(): IViewState { const compatViewState = this.viewLayout.saveState(); const scrollTop = compatViewState.scrollTop; @@ -437,7 +471,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel }; } - public reduceRestoreState(state: editorCommon.IViewState): { scrollLeft: number; scrollTop: number; } { + public reduceRestoreState(state: IViewState): { scrollLeft: number; scrollTop: number; } { if (typeof state.firstPosition === 'undefined') { // This is a view state serialized by an older version return this._reduceRestoreStateCompatibility(state); @@ -452,7 +486,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel }; } - private _reduceRestoreStateCompatibility(state: editorCommon.IViewState): { scrollLeft: number; scrollTop: number; } { + private _reduceRestoreStateCompatibility(state: IViewState): { scrollLeft: number; scrollTop: number; } { return { scrollLeft: state.scrollLeft, scrollTop: state.scrollTopWithoutViewZones! @@ -475,8 +509,6 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel * Gives a hint that a lot of requests are about to come in for these line numbers. */ public setViewport(startLineNumber: number, endLineNumber: number, centeredLineNumber: number): void { - this.lines.warmUpLookupCache(startLineNumber, endLineNumber); - this.viewportStartLine = startLineNumber; let position = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(startLineNumber, this.getLineMinColumn(startLineNumber))); this.viewportStartLineTrackedRange = this.model._setTrackedRange(this.viewportStartLineTrackedRange, new Range(position.lineNumber, position.column, position.lineNumber, position.column), TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges); @@ -546,7 +578,8 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel mightContainNonBasicASCII, lineData.tokens, inlineDecorations, - tabSize + tabSize, + lineData.startVisibleColumn ); } @@ -563,7 +596,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel } public getAllOverviewRulerDecorations(theme: ITheme): IOverviewRulerDecorations { - return this.lines.getAllOverviewRulerDecorations(this.editorId, this.configuration.options.get(EditorOption.readOnly), theme); + return this.lines.getAllOverviewRulerDecorations(this.editorId, filterValidationDecorations(this.configuration.options), theme); } public invalidateOverviewRulerColorCache(): void { @@ -623,15 +656,15 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel return this.model.getEOL(); } - public getPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[] { + public getPlainTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean, forceCRLF: boolean): string | string[] { const newLineCharacter = forceCRLF ? '\r\n' : this.model.getEOL(); - ranges = ranges.slice(0); - ranges.sort(Range.compareRangesUsingStarts); + modelRanges = modelRanges.slice(0); + modelRanges.sort(Range.compareRangesUsingStarts); let hasEmptyRange = false; let hasNonEmptyRange = false; - for (const range of ranges) { + for (const range of modelRanges) { if (range.isEmpty()) { hasEmptyRange = true; } else { @@ -645,10 +678,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel return ''; } - const modelLineNumbers = ranges.map((r) => { - const viewLineStart = new Position(r.startLineNumber, 1); - return this.coordinatesConverter.convertViewPositionToModelPosition(viewLineStart).lineNumber; - }); + const modelLineNumbers = modelRanges.map((r) => r.startLineNumber); let result = ''; for (let i = 0; i < modelLineNumbers.length; i++) { @@ -664,14 +694,14 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel // mixed empty selections and non-empty selections let result: string[] = []; let prevModelLineNumber = 0; - for (const range of ranges) { - const modelLineNumber = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(range.startLineNumber, 1)).lineNumber; - if (range.isEmpty()) { + for (const modelRange of modelRanges) { + const modelLineNumber = modelRange.startLineNumber; + if (modelRange.isEmpty()) { if (modelLineNumber !== prevModelLineNumber) { result.push(this.model.getLineContent(modelLineNumber)); } } else { - result.push(this.getValueInRange(range, forceCRLF ? EndOfLinePreference.CRLF : EndOfLinePreference.TextDefined)); + result.push(this.model.getValueInRange(modelRange, forceCRLF ? EndOfLinePreference.CRLF : EndOfLinePreference.TextDefined)); } prevModelLineNumber = modelLineNumber; } @@ -679,31 +709,32 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel } let result: string[] = []; - for (const range of ranges) { - if (!range.isEmpty()) { - result.push(this.getValueInRange(range, forceCRLF ? EndOfLinePreference.CRLF : EndOfLinePreference.TextDefined)); + for (const modelRange of modelRanges) { + if (!modelRange.isEmpty()) { + result.push(this.model.getValueInRange(modelRange, forceCRLF ? EndOfLinePreference.CRLF : EndOfLinePreference.TextDefined)); } } return result.length === 1 ? result[0] : result; } - public getHTMLToCopy(viewRanges: Range[], emptySelectionClipboard: boolean): string | null { - if (this.model.getLanguageIdentifier().id === LanguageId.PlainText) { + public getRichTextToCopy(modelRanges: Range[], emptySelectionClipboard: boolean): { html: string, mode: string } | null { + const languageId = this.model.getLanguageIdentifier(); + if (languageId.id === LanguageId.PlainText) { return null; } - if (viewRanges.length !== 1) { + if (modelRanges.length !== 1) { // no multiple selection support at this time return null; } - let range = this.coordinatesConverter.convertViewRangeToModelRange(viewRanges[0]); + let range = modelRanges[0]; if (range.isEmpty()) { if (!emptySelectionClipboard) { // nothing to copy return null; } - let lineNumber = range.startLineNumber; + const lineNumber = range.startLineNumber; range = new Range(lineNumber, this.model.getLineMinColumn(lineNumber), lineNumber, this.model.getLineMaxColumn(lineNumber)); } @@ -711,19 +742,22 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel const colorMap = this._getColorMap(); const fontFamily = fontInfo.fontFamily === EDITOR_FONT_DEFAULTS.fontFamily ? fontInfo.fontFamily : `'${fontInfo.fontFamily}', ${EDITOR_FONT_DEFAULTS.fontFamily}`; - return ( - `
` - + this._getHTMLToCopy(range, colorMap) - + '
' - ); + return { + mode: languageId.language, + html: ( + `
` + + this._getHTMLToCopy(range, colorMap) + + '
' + ) + }; } private _getHTMLToCopy(modelRange: Range, colorMap: string[]): string { diff --git a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts index a669b572023..5e150312ce6 100644 --- a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts @@ -13,7 +13,7 @@ import { EditorAction, ServicesAccessor, registerEditorAction, registerEditorCon 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 * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } 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'; @@ -103,7 +103,7 @@ class BracketsData { } } -export class BracketMatchingController extends Disposable implements editorCommon.IEditorContribution { +export class BracketMatchingController extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.bracketMatchingController'; public static get(editor: ICodeEditor): BracketMatchingController { diff --git a/src/vs/editor/contrib/codeAction/codeAction.ts b/src/vs/editor/contrib/codeAction/codeAction.ts index c4850175c63..b0a9aa8051f 100644 --- a/src/vs/editor/contrib/codeAction/codeAction.ts +++ b/src/vs/editor/contrib/codeAction/codeAction.ts @@ -6,16 +6,16 @@ import { equals, flatten, isNonEmptyArray, mergeSort } from 'vs/base/common/arrays'; import { CancellationToken } from 'vs/base/common/cancellation'; import { illegalArgument, isPromiseCanceledError, onUnexpectedExternalError } from 'vs/base/common/errors'; +import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; +import { TextModelCancellationTokenSource } from 'vs/editor/browser/core/editorState'; import { registerLanguageCommand } from 'vs/editor/browser/editorExtensions'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { ITextModel } from 'vs/editor/common/model'; -import { CodeAction, CodeActionContext, CodeActionProviderRegistry, CodeActionTrigger as CodeActionTriggerKind } from 'vs/editor/common/modes'; +import * as modes from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; import { CodeActionFilter, CodeActionKind, CodeActionTrigger, filtersAction, mayIncludeActionsOfKind } from './types'; -import { TextModelCancellationTokenSource } from 'vs/editor/browser/core/editorState'; -import { DisposableStore, IDisposable, Disposable } from 'vs/base/common/lifecycle'; export const codeActionCommandId = 'editor.action.codeAction'; export const refactorCommandId = 'editor.action.refactor'; @@ -24,14 +24,14 @@ export const organizeImportsCommandId = 'editor.action.organizeImports'; export const fixAllCommandId = 'editor.action.fixAll'; export interface CodeActionSet extends IDisposable { - readonly validActions: readonly CodeAction[]; - readonly allActions: readonly CodeAction[]; + readonly validActions: readonly modes.CodeAction[]; + readonly allActions: readonly modes.CodeAction[]; readonly hasAutoFix: boolean; } class ManagedCodeActionSet extends Disposable implements CodeActionSet { - private static codeActionsComparator(a: CodeAction, b: CodeAction): number { + private static codeActionsComparator(a: modes.CodeAction, b: modes.CodeAction): number { if (isNonEmptyArray(a.diagnostics)) { if (isNonEmptyArray(b.diagnostics)) { return a.diagnostics[0].message.localeCompare(b.diagnostics[0].message); @@ -45,10 +45,10 @@ class ManagedCodeActionSet extends Disposable implements CodeActionSet { } } - public readonly validActions: readonly CodeAction[]; - public readonly allActions: readonly CodeAction[]; + public readonly validActions: readonly modes.CodeAction[]; + public readonly allActions: readonly modes.CodeAction[]; - public constructor(actions: readonly CodeAction[], disposables: DisposableStore) { + public constructor(actions: readonly modes.CodeAction[], disposables: DisposableStore) { super(); this._register(disposables); this.allActions = mergeSort([...actions], ManagedCodeActionSet.codeActionsComparator); @@ -68,9 +68,9 @@ export function getCodeActions( ): Promise { const filter = trigger.filter || {}; - const codeActionContext: CodeActionContext = { + const codeActionContext: modes.CodeActionContext = { only: filter.include?.value, - trigger: trigger.type === 'manual' ? CodeActionTriggerKind.Manual : CodeActionTriggerKind.Automatic + trigger: trigger.type, }; const cts = new TextModelCancellationTokenSource(model, token); @@ -94,8 +94,8 @@ export function getCodeActions( } }); - const listener = CodeActionProviderRegistry.onDidChange(() => { - const newProviders = CodeActionProviderRegistry.all(model); + const listener = modes.CodeActionProviderRegistry.onDidChange(() => { + const newProviders = modes.CodeActionProviderRegistry.all(model); if (!equals(newProviders, providers)) { cts.cancel(); } @@ -114,7 +114,7 @@ function getCodeActionProviders( model: ITextModel, filter: CodeActionFilter ) { - return CodeActionProviderRegistry.all(model) + return modes.CodeActionProviderRegistry.all(model) // Don't include providers that we know will not return code actions of interest .filter(provider => { if (!provider.providedCodeActionKinds) { @@ -125,7 +125,7 @@ function getCodeActionProviders( }); } -registerLanguageCommand('_executeCodeActionProvider', async function (accessor, args): Promise> { +registerLanguageCommand('_executeCodeActionProvider', async function (accessor, args): Promise> { const { resource, rangeOrSelection, kind } = args; if (!(resource instanceof URI)) { throw illegalArgument(); @@ -149,7 +149,7 @@ registerLanguageCommand('_executeCodeActionProvider', async function (accessor, const codeActionSet = await getCodeActions( model, validatedRangeOrSelection, - { type: 'manual', filter: { includeSourceActions: true, include: kind && kind.value ? new CodeActionKind(kind.value) : undefined } }, + { type: modes.CodeActionTriggerType.Manual, filter: { includeSourceActions: true, include: kind && kind.value ? new CodeActionKind(kind.value) : undefined } }, CancellationToken.None); setTimeout(() => codeActionSet.dispose(), 100); diff --git a/src/vs/editor/contrib/codeAction/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/codeActionCommands.ts index 8185eca6b17..185ebd86867 100644 --- a/src/vs/editor/contrib/codeAction/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/codeActionCommands.ts @@ -15,22 +15,21 @@ import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; import { IPosition } from 'vs/editor/common/core/position'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { CodeAction } from 'vs/editor/common/modes'; -import { CodeActionSet, refactorCommandId, sourceActionCommandId, codeActionCommandId, organizeImportsCommandId, fixAllCommandId } from 'vs/editor/contrib/codeAction/codeAction'; +import { CodeAction, CodeActionTriggerType } from 'vs/editor/common/modes'; +import { codeActionCommandId, CodeActionSet, fixAllCommandId, organizeImportsCommandId, refactorCommandId, sourceActionCommandId } from 'vs/editor/contrib/codeAction/codeAction'; import { CodeActionUi } from 'vs/editor/contrib/codeAction/codeActionUi'; import { MessageController } from 'vs/editor/contrib/message/messageController'; import * as nls from 'vs/nls'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { ContextKeyExpr, 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 { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IMarkerService } from 'vs/platform/markers/common/markers'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IEditorProgressService } from 'vs/platform/progress/common/progress'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { CodeActionModel, CodeActionsState, SUPPORTED_CODE_ACTIONS } from './codeActionModel'; -import { CodeActionAutoApply, CodeActionFilter, CodeActionKind, CodeActionTrigger, CodeActionCommandArgs } from './types'; +import { CodeActionAutoApply, CodeActionCommandArgs, CodeActionFilter, CodeActionKind, CodeActionTrigger } from './types'; function contextKeyForSupportedActions(kind: CodeActionKind) { return ContextKeyExpr.regex( @@ -83,10 +82,6 @@ export class QuickFixController extends Disposable implements IEditorContributio @IMarkerService markerService: IMarkerService, @IContextKeyService contextKeyService: IContextKeyService, @IEditorProgressService progressService: IEditorProgressService, - @IContextMenuService contextMenuService: IContextMenuService, - @IKeybindingService keybindingService: IKeybindingService, - @ICommandService private readonly _commandService: ICommandService, - @IBulkEditService private readonly _bulkEditService: IBulkEditService, @IInstantiationService private readonly _instantiationService: IInstantiationService, ) { super(); @@ -102,7 +97,7 @@ export class QuickFixController extends Disposable implements IEditorContributio await this._applyCodeAction(action); } finally { if (retrigger) { - this._trigger({ type: 'auto', filter: {} }); + this._trigger({ type: CodeActionTriggerType.Auto, filter: {} }); } } } @@ -114,8 +109,8 @@ export class QuickFixController extends Disposable implements IEditorContributio this._ui.getValue().update(newState); } - public showCodeActions(actions: CodeActionSet, at: IAnchor | IPosition) { - return this._ui.getValue().showCodeActionList(actions, at, { includeDisabledActions: false }); + public showCodeActions(trigger: CodeActionTrigger, actions: CodeActionSet, at: IAnchor | IPosition) { + return this._ui.getValue().showCodeActionList(trigger, actions, at, { includeDisabledActions: false }); } public manualTriggerAtCurrentPosition( @@ -129,7 +124,7 @@ export class QuickFixController extends Disposable implements IEditorContributio MessageController.get(this._editor).closeMessage(); const triggerPosition = this._editor.getPosition(); - this._trigger({ type: 'manual', filter, autoApply, context: { notAvailableMessage, position: triggerPosition } }); + this._trigger({ type: CodeActionTriggerType.Manual, filter, autoApply, context: { notAvailableMessage, position: triggerPosition } }); } private _trigger(trigger: CodeActionTrigger) { @@ -137,21 +132,41 @@ export class QuickFixController extends Disposable implements IEditorContributio } private _applyCodeAction(action: CodeAction): Promise { - return this._instantiationService.invokeFunction(applyCodeAction, action, this._bulkEditService, this._commandService, this._editor); + return this._instantiationService.invokeFunction(applyCodeAction, action, this._editor); } } export async function applyCodeAction( accessor: ServicesAccessor, action: CodeAction, - bulkEditService: IBulkEditService, - commandService: ICommandService, editor?: ICodeEditor, ): Promise { + const bulkEditService = accessor.get(IBulkEditService); + const commandService = accessor.get(ICommandService); + const telemetryService = accessor.get(ITelemetryService); const notificationService = accessor.get(INotificationService); + + type ApplyCodeActionEvent = { + codeActionTitle: string; + codeActionKind: string | undefined; + codeActionIsPreferred: boolean; + }; + type ApplyCodeEventClassification = { + codeActionTitle: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + codeActionKind: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + codeActionIsPreferred: { classification: 'SystemMetaData', purpose: 'FeatureInsight' }; + }; + + telemetryService.publicLog2('codeAction.applyCodeAction', { + codeActionTitle: action.title, + codeActionKind: action.kind, + codeActionIsPreferred: !!action.isPreferred, + }); + if (action.edit) { await bulkEditService.apply(action.edit, { editor }); } + if (action.command) { try { await commandService.executeCommand(action.command.id, ...(action.command.arguments || [])); @@ -161,7 +176,6 @@ export async function applyCodeAction( typeof message === 'string' ? message : nls.localize('applyCodeActionFailed', "An unknown error occurred while applying the code action")); - } } } diff --git a/src/vs/editor/contrib/codeAction/codeActionMenu.ts b/src/vs/editor/contrib/codeAction/codeActionMenu.ts index 7be72d3d2e3..e732dec94c3 100644 --- a/src/vs/editor/contrib/codeAction/codeActionMenu.ts +++ b/src/vs/editor/contrib/codeAction/codeActionMenu.ts @@ -14,9 +14,9 @@ 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 { ScrollType } from 'vs/editor/common/editorCommon'; -import { CodeAction } from 'vs/editor/common/modes'; +import { CodeAction, CodeActionProviderRegistry } from 'vs/editor/common/modes'; import { codeActionCommandId, CodeActionSet, fixAllCommandId, organizeImportsCommandId, refactorCommandId, sourceActionCommandId } from 'vs/editor/contrib/codeAction/codeAction'; -import { CodeActionAutoApply, CodeActionCommandArgs, CodeActionKind } from 'vs/editor/contrib/codeAction/types'; +import { CodeActionAutoApply, CodeActionCommandArgs, CodeActionKind, CodeActionTrigger } from 'vs/editor/contrib/codeAction/types'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; @@ -68,7 +68,7 @@ export class CodeActionMenu extends Disposable { return this._visible; } - public async show(codeActions: CodeActionSet, at: IAnchor | IPosition, options: CodeActionShowOptions): Promise { + public async show(trigger: CodeActionTrigger, codeActions: CodeActionSet, at: IAnchor | IPosition, options: CodeActionShowOptions): Promise { const actionsToShow = options.includeDisabledActions ? codeActions.allActions : codeActions.validActions; if (!actionsToShow.length) { this._visible = false; @@ -84,7 +84,7 @@ export class CodeActionMenu extends Disposable { this._visible = true; this._showingActions.value = codeActions; - const menuActions = this.getMenuActions(actionsToShow); + const menuActions = this.getMenuActions(trigger, actionsToShow); const anchor = Position.isIPosition(at) ? this._toCoords(at) : at || { x: 0, y: 0 }; const resolver = this._keybindingResolver.getResolver(); @@ -101,19 +101,26 @@ export class CodeActionMenu extends Disposable { }); } - private getMenuActions(actionsToShow: readonly CodeAction[]): IAction[] { - const allActions = actionsToShow - .map(action => new CodeActionAction(action, () => this._delegate.onSelectCodeAction(action))); + private getMenuActions(trigger: CodeActionTrigger, actionsToShow: readonly CodeAction[]): IAction[] { + const toCodeActionAction = (action: CodeAction): CodeActionAction => new CodeActionAction(action, () => this._delegate.onSelectCodeAction(action)); - // Treat documentation actions as special - const result: IAction[] = allActions - .filter(action => !action.action.kind || !CodeActionKind.RefactorDocumentation.contains(new CodeActionKind(action.action.kind))); + const result: IAction[] = actionsToShow + .map(toCodeActionAction); - const documentationActions = allActions - .filter(action => action.action.kind && CodeActionKind.RefactorDocumentation.contains(new CodeActionKind(action.action.kind))); - if (documentationActions.length) { - result.push(new Separator(), ...documentationActions); + const model = this._editor.getModel(); + if (model && result.length) { + for (const provider of CodeActionProviderRegistry.all(model)) { + if (provider._getAdditionalMenuItems) { + const items = provider._getAdditionalMenuItems({ trigger: trigger.type, only: trigger.filter?.include?.value }, actionsToShow); + if (items.length) { + result.push(new Separator(), ...items.map(command => toCodeActionAction({ + title: command.title, + command: command, + }))); + } + } + } } return result; diff --git a/src/vs/editor/contrib/codeAction/codeActionModel.ts b/src/vs/editor/contrib/codeAction/codeActionModel.ts index e5743489005..e8645271f35 100644 --- a/src/vs/editor/contrib/codeAction/codeActionModel.ts +++ b/src/vs/editor/contrib/codeAction/codeActionModel.ts @@ -11,7 +11,7 @@ import { 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 { CodeActionProviderRegistry } from 'vs/editor/common/modes'; +import { CodeActionProviderRegistry, CodeActionTriggerType } from 'vs/editor/common/modes'; import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IMarkerService } from 'vs/platform/markers/common/markers'; import { IEditorProgressService } from 'vs/platform/progress/common/progress'; @@ -56,14 +56,14 @@ class CodeActionOracle extends Disposable { if (resources.some(resource => isEqual(resource, model.uri))) { this._autoTriggerTimer.cancelAndSet(() => { - this.trigger({ type: 'auto' }); + this.trigger({ type: CodeActionTriggerType.Auto }); }, this._delay); } } private _onCursorChange(): void { this._autoTriggerTimer.cancelAndSet(() => { - this.trigger({ type: 'auto' }); + this.trigger({ type: CodeActionTriggerType.Auto }); }, this._delay); } @@ -88,7 +88,7 @@ class CodeActionOracle extends Disposable { } const model = this._editor.getModel(); const selection = this._editor.getSelection(); - if (selection.isEmpty() && trigger.type === 'auto') { + if (selection.isEmpty() && trigger.type === CodeActionTriggerType.Auto) { const { lineNumber, column } = selection.getPosition(); const line = model.getLineContent(lineNumber); if (line.length === 0) { @@ -214,14 +214,14 @@ export class CodeActionModel extends Disposable { } const actions = createCancelablePromise(token => getCodeActions(model, trigger.selection, trigger.trigger, token)); - if (this._progressService && trigger.trigger.type === 'manual') { + if (this._progressService && trigger.trigger.type === CodeActionTriggerType.Manual) { this._progressService.showWhile(actions, 250); } this.setState(new CodeActionsState.Triggered(trigger.trigger, trigger.selection, trigger.position, actions)); }, undefined); - this._codeActionOracle.value.trigger({ type: 'auto' }); + this._codeActionOracle.value.trigger({ type: CodeActionTriggerType.Auto }); } else { this._supportedCodeActions.reset(); } diff --git a/src/vs/editor/contrib/codeAction/codeActionUi.ts b/src/vs/editor/contrib/codeAction/codeActionUi.ts index 5c34b32fe7f..7d2aeff74f3 100644 --- a/src/vs/editor/contrib/codeAction/codeActionUi.ts +++ b/src/vs/editor/contrib/codeAction/codeActionUi.ts @@ -10,14 +10,14 @@ import { Lazy } from 'vs/base/common/lazy'; import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IPosition } from 'vs/editor/common/core/position'; -import { CodeAction } from 'vs/editor/common/modes'; +import { CodeAction, CodeActionTriggerType } from 'vs/editor/common/modes'; import { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction'; import { MessageController } from 'vs/editor/contrib/message/messageController'; -import { CodeActionsState } from './codeActionModel'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { CodeActionMenu, CodeActionShowOptions } from './codeActionMenu'; +import { CodeActionsState } from './codeActionModel'; import { LightBulbWidget } from './lightBulbWidget'; import { CodeActionAutoApply, CodeActionTrigger } from './types'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; export class CodeActionUi extends Disposable { @@ -46,7 +46,7 @@ export class CodeActionUi extends Disposable { this._lightBulbWidget = new Lazy(() => { const widget = this._register(instantiationService.createInstance(LightBulbWidget, this._editor, quickFixActionId, preferredFixActionId)); - this._register(widget.onClick(e => this.showCodeActionList(e.actions, e, { includeDisabledActions: false }))); + this._register(widget.onClick(e => this.showCodeActionList(e.trigger, e.actions, e, { includeDisabledActions: false }))); return widget; }); } @@ -65,9 +65,9 @@ export class CodeActionUi extends Disposable { return; } - this._lightBulbWidget.getValue().update(actions, newState.position); + this._lightBulbWidget.getValue().update(actions, newState.trigger, newState.position); - if (newState.trigger.type === 'manual') { + if (newState.trigger.type === CodeActionTriggerType.Manual) { if (newState.trigger.filter?.include) { // Triggered for specific scope // Check to see if we want to auto apply. @@ -103,7 +103,7 @@ export class CodeActionUi extends Disposable { } this._activeCodeActions.value = actions; - this._codeActionWidget.getValue().show(actions, newState.position, { includeDisabledActions }); + this._codeActionWidget.getValue().show(newState.trigger, actions, newState.position, { includeDisabledActions }); } else { // auto magically triggered if (this._codeActionWidget.getValue().isVisible) { @@ -143,7 +143,7 @@ export class CodeActionUi extends Disposable { return undefined; } - public async showCodeActionList(actions: CodeActionSet, at: IAnchor | IPosition, options: CodeActionShowOptions): Promise { - this._codeActionWidget.getValue().show(actions, at, options); + public async showCodeActionList(trigger: CodeActionTrigger, actions: CodeActionSet, at: IAnchor | IPosition, options: CodeActionShowOptions): Promise { + this._codeActionWidget.getValue().show(trigger, actions, at, options); } } diff --git a/src/vs/editor/contrib/codeAction/lightBulbWidget.ts b/src/vs/editor/contrib/codeAction/lightBulbWidget.ts index 66c9a7786f0..04712201151 100644 --- a/src/vs/editor/contrib/codeAction/lightBulbWidget.ts +++ b/src/vs/editor/contrib/codeAction/lightBulbWidget.ts @@ -18,6 +18,7 @@ import { EditorOption } from 'vs/editor/common/config/editorOptions'; import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { editorLightBulbForeground, editorLightBulbAutoFixForeground } from 'vs/platform/theme/common/colorRegistry'; import { Gesture } from 'vs/base/browser/touch'; +import type { CodeActionTrigger } from 'vs/editor/contrib/codeAction/types'; namespace LightBulbState { @@ -33,6 +34,7 @@ namespace LightBulbState { constructor( public readonly actions: CodeActionSet, + public readonly trigger: CodeActionTrigger, public readonly editorPosition: IPosition, public readonly widgetPosition: IContentWidgetPosition, ) { } @@ -48,7 +50,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget { private readonly _domNode: HTMLDivElement; - private readonly _onClick = this._register(new Emitter<{ x: number; y: number; actions: CodeActionSet; }>()); + private readonly _onClick = this._register(new Emitter<{ x: number; y: number; actions: CodeActionSet; trigger: CodeActionTrigger }>()); public readonly onClick = this._onClick.event; private _state: LightBulbState.State = LightBulbState.Hidden; @@ -95,7 +97,8 @@ export class LightBulbWidget extends Disposable implements IContentWidget { this._onClick.fire({ x: e.posx, y: top + height + pad, - actions: this.state.actions + actions: this.state.actions, + trigger: this.state.trigger, }); })); this._register(dom.addDisposableListener(this._domNode, 'mouseenter', (e: MouseEvent) => { @@ -107,7 +110,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget { // showings until mouse is released this.hide(); const monitor = new GlobalMouseMoveMonitor(); - monitor.startMonitoring(standardMouseMoveMerger, () => { }, () => { + monitor.startMonitoring(e.target, e.buttons, standardMouseMoveMerger, () => { }, () => { monitor.dispose(); }); })); @@ -139,7 +142,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget { return this._state.type === LightBulbState.Type.Showing ? this._state.widgetPosition : null; } - public update(actions: CodeActionSet, atPosition: IPosition) { + public update(actions: CodeActionSet, trigger: CodeActionTrigger, atPosition: IPosition) { if (actions.validActions.length <= 0) { return this.hide(); } @@ -177,7 +180,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget { } } - this.state = new LightBulbState.Showing(actions, atPosition, { + this.state = new LightBulbState.Showing(actions, trigger, atPosition, { position: { lineNumber: effectiveLineNumber, column: 1 }, preference: LightBulbWidget._posPref }); diff --git a/src/vs/editor/contrib/codeAction/test/codeAction.test.ts b/src/vs/editor/contrib/codeAction/test/codeAction.test.ts index 0b7fb8ba4a6..0af6b11bb24 100644 --- a/src/vs/editor/contrib/codeAction/test/codeAction.test.ts +++ b/src/vs/editor/contrib/codeAction/test/codeAction.test.ts @@ -69,7 +69,7 @@ suite('CodeAction', () => { bcd: { diagnostics: [], edit: new class implements modes.WorkspaceEdit { - edits!: modes.ResourceTextEdit[]; + edits!: modes.WorkspaceTextEdit[]; }, title: 'abc' } @@ -125,7 +125,7 @@ suite('CodeAction', () => { testData.tsLint.abc ]; - const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'manual' }, CancellationToken.None); + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Manual }, CancellationToken.None); assert.equal(actions.length, 6); assert.deepEqual(actions, expected); }); @@ -140,20 +140,20 @@ suite('CodeAction', () => { disposables.add(modes.CodeActionProviderRegistry.register('fooLang', provider)); { - const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto', filter: { include: new CodeActionKind('a') } }, CancellationToken.None); + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Auto, filter: { include: new CodeActionKind('a') } }, CancellationToken.None); assert.equal(actions.length, 2); assert.strictEqual(actions[0].title, 'a'); assert.strictEqual(actions[1].title, 'a.b'); } { - const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto', filter: { include: new CodeActionKind('a.b') } }, CancellationToken.None); + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Auto, filter: { include: new CodeActionKind('a.b') } }, CancellationToken.None); assert.equal(actions.length, 1); assert.strictEqual(actions[0].title, 'a.b'); } { - const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto', filter: { include: new CodeActionKind('a.b.c') } }, CancellationToken.None); + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Auto, filter: { include: new CodeActionKind('a.b.c') } }, CancellationToken.None); assert.equal(actions.length, 0); } }); @@ -172,7 +172,7 @@ suite('CodeAction', () => { disposables.add(modes.CodeActionProviderRegistry.register('fooLang', provider)); - const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto', filter: { include: new CodeActionKind('a') } }, CancellationToken.None); + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Auto, filter: { include: new CodeActionKind('a') } }, CancellationToken.None); assert.equal(actions.length, 1); assert.strictEqual(actions[0].title, 'a'); }); @@ -186,13 +186,13 @@ suite('CodeAction', () => { disposables.add(modes.CodeActionProviderRegistry.register('fooLang', provider)); { - const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto' }, CancellationToken.None); + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Auto }, CancellationToken.None); assert.equal(actions.length, 1); assert.strictEqual(actions[0].title, 'b'); } { - const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto', filter: { include: CodeActionKind.Source, includeSourceActions: true } }, CancellationToken.None); + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Auto, filter: { include: CodeActionKind.Source, includeSourceActions: true } }, CancellationToken.None); assert.equal(actions.length, 1); assert.strictEqual(actions[0].title, 'a'); } @@ -209,7 +209,7 @@ suite('CodeAction', () => { { const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { - type: 'auto', filter: { + type: modes.CodeActionTriggerType.Auto, filter: { include: CodeActionKind.Source.append('test'), excludes: [CodeActionKind.Source], includeSourceActions: true, @@ -220,6 +220,43 @@ suite('CodeAction', () => { } }); + test('getCodeActions no invoke a provider that has been excluded #84602', async function () { + const baseType = CodeActionKind.Refactor; + const subType = CodeActionKind.Refactor.append('sub'); + + disposables.add(modes.CodeActionProviderRegistry.register('fooLang', staticCodeActionProvider( + { title: 'a', kind: baseType.value } + ))); + + let didInvoke = false; + disposables.add(modes.CodeActionProviderRegistry.register('fooLang', new class implements modes.CodeActionProvider { + + providedCodeActionKinds = [subType.value]; + + provideCodeActions(): modes.ProviderResult { + didInvoke = true; + return { + actions: [ + { title: 'x', kind: subType.value } + ], + dispose: () => { } + }; + } + })); + + { + const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { + type: modes.CodeActionTriggerType.Auto, filter: { + include: baseType, + excludes: [subType], + } + }, CancellationToken.None); + assert.strictEqual(didInvoke, false); + assert.equal(actions.length, 1); + assert.strictEqual(actions[0].title, 'a'); + } + }); + test('getCodeActions should not invoke code action providers filtered out by providedCodeActionKinds', async function () { let wasInvoked = false; const provider = new class implements modes.CodeActionProvider { @@ -234,7 +271,7 @@ suite('CodeAction', () => { disposables.add(modes.CodeActionProviderRegistry.register('fooLang', provider)); const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { - type: 'auto', + type: modes.CodeActionTriggerType.Auto, filter: { include: CodeActionKind.QuickFix } diff --git a/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts b/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts index c4a7cba5173..c605ed49ab6 100644 --- a/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts +++ b/src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts @@ -59,7 +59,7 @@ suite('CodeActionModel', () => { disposables.add(model.onDidChangeState((e: CodeActionsState.State) => { assertType(e.type === CodeActionsState.Type.Triggered); - assert.strictEqual(e.trigger.type, 'auto'); + assert.strictEqual(e.trigger.type, modes.CodeActionTriggerType.Auto); assert.ok(e.actions); e.actions.then(fixes => { @@ -100,7 +100,7 @@ suite('CodeActionModel', () => { disposables.add(model.onDidChangeState((e: CodeActionsState.State) => { assertType(e.type === CodeActionsState.Type.Triggered); - assert.equal(e.trigger.type, 'auto'); + assert.equal(e.trigger.type, modes.CodeActionTriggerType.Auto); assert.ok(e.actions); e.actions.then(fixes => { model.dispose(); @@ -138,7 +138,7 @@ suite('CodeActionModel', () => { disposables.add(model.onDidChangeState((e: CodeActionsState.State) => { assertType(e.type === CodeActionsState.Type.Triggered); - assert.equal(e.trigger.type, 'auto'); + assert.equal(e.trigger.type, modes.CodeActionTriggerType.Auto); const selection = e.rangeOrSelection; assert.deepEqual(selection.selectionStartLineNumber, 1); assert.deepEqual(selection.selectionStartColumn, 1); @@ -163,7 +163,7 @@ suite('CodeActionModel', () => { disposables.add(model.onDidChangeState((e: CodeActionsState.State) => { assertType(e.type === CodeActionsState.Type.Triggered); - assert.equal(e.trigger.type, 'auto'); + assert.equal(e.trigger.type, modes.CodeActionTriggerType.Auto); ++triggerCount; // give time for second trigger before completing test diff --git a/src/vs/editor/contrib/codeAction/types.ts b/src/vs/editor/contrib/codeAction/types.ts index bce9f612329..b8f8c5e741e 100644 --- a/src/vs/editor/contrib/codeAction/types.ts +++ b/src/vs/editor/contrib/codeAction/types.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { startsWith } from 'vs/base/common/strings'; -import { CodeAction } from 'vs/editor/common/modes'; +import { CodeAction, CodeActionTriggerType } from 'vs/editor/common/modes'; import { Position } from 'vs/editor/common/core/position'; export class CodeActionKind { @@ -14,7 +14,6 @@ export class CodeActionKind { public static readonly Empty = new CodeActionKind(''); public static readonly QuickFix = new CodeActionKind('quickfix'); public static readonly Refactor = new CodeActionKind('refactor'); - public static readonly RefactorDocumentation = new CodeActionKind('refactor.documentation'); public static readonly Source = new CodeActionKind('source'); public static readonly SourceOrganizeImports = CodeActionKind.Source.append('organizeImports'); public static readonly SourceFixAll = CodeActionKind.Source.append('fixAll'); @@ -59,6 +58,12 @@ export function mayIncludeActionsOfKind(filter: CodeActionFilter, providedKind: return false; } + if (filter.excludes) { + if (filter.excludes.some(exclude => excludesAction(providedKind, exclude, filter.include))) { + return false; + } + } + // Don't return source actions unless they are explicitly requested if (!filter.includeSourceActions && CodeActionKind.Source.contains(providedKind)) { return false; @@ -78,10 +83,7 @@ export function filtersAction(filter: CodeActionFilter, action: CodeAction): boo } if (filter.excludes) { - if (actionKind && filter.excludes.some(exclude => { - // Excludes are overwritten by includes - return exclude.contains(actionKind) && (!filter.include || !filter.include.contains(actionKind)); - })) { + if (actionKind && filter.excludes.some(exclude => excludesAction(actionKind, exclude, filter.include))) { return false; } } @@ -102,8 +104,19 @@ export function filtersAction(filter: CodeActionFilter, action: CodeAction): boo return true; } +function excludesAction(providedKind: CodeActionKind, exclude: CodeActionKind, include: CodeActionKind | undefined): boolean { + if (!exclude.contains(providedKind)) { + return false; + } + if (include && exclude.contains(include)) { + // The include is more specific, don't filter out + return false; + } + return true; +} + export interface CodeActionTrigger { - readonly type: 'auto' | 'manual'; + readonly type: CodeActionTriggerType; readonly filter?: CodeActionFilter; readonly autoApply?: CodeActionAutoApply; readonly context?: { diff --git a/src/vs/editor/contrib/codelens/codelensController.ts b/src/vs/editor/contrib/codelens/codelensController.ts index 40fca0ab3bd..2b4865134c3 100644 --- a/src/vs/editor/contrib/codelens/codelensController.ts +++ b/src/vs/editor/contrib/codelens/codelensController.ts @@ -7,9 +7,9 @@ import { CancelablePromise, RunOnceScheduler, createCancelablePromise, disposabl import { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; import { toDisposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; import { StableEditorScrollState } from 'vs/editor/browser/core/editorState'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; +import { ICodeEditor, MouseTargetType, IViewZoneChangeAccessor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { IModelDecorationsChangeAccessor } from 'vs/editor/common/model'; import { CodeLensProviderRegistry, CodeLens } from 'vs/editor/common/modes'; import { CodeLensModel, getCodeLensData, CodeLensItem } from 'vs/editor/contrib/codelens/codelens'; @@ -18,10 +18,10 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ICodeLensCache } from 'vs/editor/contrib/codelens/codeLensCache'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; -import { createStyleSheet } from 'vs/base/browser/dom'; +import * as dom from 'vs/base/browser/dom'; import { hash } from 'vs/base/common/hash'; -export class CodeLensContribution implements editorCommon.IEditorContribution { +export class CodeLensContribution implements IEditorContribution { public static readonly ID: string = 'css.editor.codeLens'; @@ -40,7 +40,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { private _detectVisibleLenses: RunOnceScheduler | undefined; constructor( - private readonly _editor: editorBrowser.ICodeEditor, + private readonly _editor: ICodeEditor, @ICommandService private readonly _commandService: ICommandService, @INotificationService private readonly _notificationService: INotificationService, @ICodeLensCache private readonly _codeLensCache: ICodeLensCache @@ -65,7 +65,11 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._onModelChange(); this._styleClassName = hash(this._editor.getId()).toString(16); - this._styleElement = createStyleSheet(); + this._styleElement = dom.createStyleSheet( + dom.isInShadowDOM(this._editor.getContainerDomNode()) + ? this._editor.getContainerDomNode() + : undefined + ); this._updateLensStyle(); } @@ -81,7 +85,13 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { const fontInfo = options.get(EditorOption.fontInfo); const lineHeight = options.get(EditorOption.lineHeight); - const newStyle = `.monaco-editor .codelens-decoration.${this._styleClassName} { height: ${Math.round(lineHeight * 1.1)}px; line-height: ${lineHeight}px; font-size: ${Math.round(fontInfo.fontSize * 0.9)}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;}`; + + const height = Math.round(lineHeight * 1.1); + const fontSize = Math.round(fontInfo.fontSize * 0.9); + const newStyle = ` + .monaco-editor .codelens-decoration.${this._styleClassName} { height: ${height}px; line-height: ${lineHeight}px; font-size: ${fontSize}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;} + .monaco-editor .codelens-decoration.${this._styleClassName} > a > .codicon { line-height: ${lineHeight}px; font-size: ${fontSize}px; } + `; this._styleElement.innerHTML = newStyle; } @@ -223,7 +233,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { } })); this._localToDispose.add(this._editor.onMouseUp(e => { - if (e.target.type !== editorBrowser.MouseTargetType.CONTENT_WIDGET) { + if (e.target.type !== MouseTargetType.CONTENT_WIDGET) { return; } let target = e.target.element; @@ -243,7 +253,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { scheduler.schedule(); } - private _disposeAllLenses(decChangeAccessor: IModelDecorationsChangeAccessor | undefined, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor | undefined): void { + private _disposeAllLenses(decChangeAccessor: IModelDecorationsChangeAccessor | undefined, viewZoneChangeAccessor: IViewZoneChangeAccessor | undefined): void { const helper = new CodeLensHelper(); for (const lens of this._lenses) { lens.dispose(helper, viewZoneChangeAccessor); @@ -300,7 +310,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { groupsIndex++; codeLensIndex++; } else { - this._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], this._editor, this._styleClassName, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); + this._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], this._editor, this._styleClassName, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); codeLensIndex++; groupsIndex++; } @@ -314,7 +324,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { // Create extra symbols while (groupsIndex < groups.length) { - this._lenses.push(new CodeLensWidget(groups[groupsIndex], this._editor, this._styleClassName, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); + this._lenses.push(new CodeLensWidget(groups[groupsIndex], this._editor, this._styleClassName, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); groupsIndex++; } diff --git a/src/vs/editor/contrib/codelens/codelensWidget.css b/src/vs/editor/contrib/codelens/codelensWidget.css index 79eae29cea9..7bd66d08fd8 100644 --- a/src/vs/editor/contrib/codelens/codelensWidget.css +++ b/src/vs/editor/contrib/codelens/codelensWidget.css @@ -27,9 +27,8 @@ } .monaco-editor .codelens-decoration .codicon { - line-height: inherit; - font-size: 110%; - vertical-align: inherit; + vertical-align: middle; + color: currentColor !important; } .monaco-editor .codelens-decoration > a:hover .codicon::before { diff --git a/src/vs/editor/contrib/codelens/codelensWidget.ts b/src/vs/editor/contrib/codelens/codelensWidget.ts index a661af5def1..622e7785aaf 100644 --- a/src/vs/editor/contrib/codelens/codelensWidget.ts +++ b/src/vs/editor/contrib/codelens/codelensWidget.ts @@ -7,7 +7,7 @@ import 'vs/css!./codelensWidget'; import * as dom from 'vs/base/browser/dom'; import { renderCodicons } from 'vs/base/common/codicons'; import { escape } from 'vs/base/common/strings'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; +import { IViewZone, IContentWidget, IActiveCodeEditor, IContentWidgetPosition, ContentWidgetPositionPreference, 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'; @@ -17,7 +17,7 @@ import { CodeLensItem } from 'vs/editor/contrib/codelens/codelens'; import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -class CodeLensViewZone implements editorBrowser.IViewZone { +class CodeLensViewZone implements IViewZone { readonly heightInLines: number; readonly suppressMouseDown: boolean; @@ -47,7 +47,7 @@ class CodeLensViewZone implements editorBrowser.IViewZone { } } -class CodeLensContentWidget implements editorBrowser.IContentWidget { +class CodeLensContentWidget implements IContentWidget { private static _idPool: number = 0; @@ -57,14 +57,14 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget { private readonly _id: string; private readonly _domNode: HTMLElement; - private readonly _editor: editorBrowser.IActiveCodeEditor; + private readonly _editor: IActiveCodeEditor; private readonly _commands = new Map(); - private _widgetPosition?: editorBrowser.IContentWidgetPosition; + private _widgetPosition?: IContentWidgetPosition; private _isEmpty: boolean = true; constructor( - editor: editorBrowser.IActiveCodeEditor, + editor: IActiveCodeEditor, className: string, line: number, ) { @@ -137,11 +137,11 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget { const column = this._editor.getModel().getLineFirstNonWhitespaceColumn(line); this._widgetPosition = { position: { lineNumber: line, column: column }, - preference: [editorBrowser.ContentWidgetPositionPreference.ABOVE] + preference: [ContentWidgetPositionPreference.ABOVE] }; } - getPosition(): editorBrowser.IContentWidgetPosition | null { + getPosition(): IContentWidgetPosition | null { return this._widgetPosition || null; } } @@ -181,7 +181,7 @@ export class CodeLensHelper { export class CodeLensWidget { - private readonly _editor: editorBrowser.IActiveCodeEditor; + private readonly _editor: IActiveCodeEditor; private readonly _className: string; private readonly _viewZone!: CodeLensViewZone; private readonly _viewZoneId!: string; @@ -193,10 +193,10 @@ export class CodeLensWidget { constructor( data: CodeLensItem[], - editor: editorBrowser.IActiveCodeEditor, + editor: IActiveCodeEditor, className: string, helper: CodeLensHelper, - viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor, + viewZoneChangeAccessor: IViewZoneChangeAccessor, updateCallback: Function ) { this._editor = editor; @@ -244,7 +244,7 @@ export class CodeLensWidget { } } - dispose(helper: CodeLensHelper, viewZoneChangeAccessor?: editorBrowser.IViewZoneChangeAccessor): void { + dispose(helper: CodeLensHelper, viewZoneChangeAccessor?: IViewZoneChangeAccessor): void { this._decorationIds.forEach(helper.removeDecoration, helper); this._decorationIds = []; if (viewZoneChangeAccessor) { @@ -322,7 +322,7 @@ export class CodeLensWidget { return -1; } - update(viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { + update(viewZoneChangeAccessor: IViewZoneChangeAccessor): void { if (this.isValid()) { const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); if (range) { diff --git a/src/vs/editor/contrib/colorPicker/colorDetector.ts b/src/vs/editor/contrib/colorPicker/colorDetector.ts index 9e2113c38d9..90f0db8ac67 100644 --- a/src/vs/editor/contrib/colorPicker/colorDetector.ts +++ b/src/vs/editor/contrib/colorPicker/colorDetector.ts @@ -192,7 +192,7 @@ export class ColorDetector extends Disposable implements IEditorContribution { border: 'solid 0.1em #eee' } } - }); + }, undefined, this._editor); } newDecorationsTypes[key] = true; diff --git a/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts b/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts index 98ce2b09ca5..68de080e7d6 100644 --- a/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts +++ b/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts @@ -163,7 +163,7 @@ class SaturationBox extends Disposable { this.onDidChangePosition(e.offsetX, e.offsetY); } - this.monitor.startMonitoring(standardMouseMoveMerger, event => this.onDidChangePosition(event.posx - origin.left, event.posy - origin.top), () => null); + this.monitor.startMonitoring(e.target, e.buttons, standardMouseMoveMerger, event => this.onDidChangePosition(event.posx - origin.left, event.posy - origin.top), () => null); const mouseUpListener = dom.addDisposableGenericMouseUpListner(document, () => { this._onColorFlushed.fire(); @@ -270,7 +270,7 @@ abstract class Strip extends Disposable { this.onDidChangeTop(e.offsetY); } - monitor.startMonitoring(standardMouseMoveMerger, event => this.onDidChangeTop(event.posy - origin.top), () => null); + monitor.startMonitoring(e.target, e.buttons, standardMouseMoveMerger, event => this.onDidChangeTop(event.posy - origin.top), () => null); const mouseUpListener = dom.addDisposableGenericMouseUpListner(document, () => { this._onColorFlushed.fire(); diff --git a/src/vs/editor/contrib/comment/blockCommentCommand.ts b/src/vs/editor/contrib/comment/blockCommentCommand.ts index 5c5273c9c35..efa593a811d 100644 --- a/src/vs/editor/contrib/comment/blockCommentCommand.ts +++ b/src/vs/editor/contrib/comment/blockCommentCommand.ts @@ -8,17 +8,19 @@ 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 * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICommand, IEditOperationBuilder, ICursorStateComputerData } from 'vs/editor/common/editorCommon'; import { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; -export class BlockCommentCommand implements editorCommon.ICommand { +export class BlockCommentCommand implements ICommand { private readonly _selection: Selection; + private readonly _insertSpace: boolean; private _usedEndToken: string | null; - constructor(selection: Selection) { + constructor(selection: Selection, insertSpace: boolean) { this._selection = selection; + this._insertSpace = insertSpace; this._usedEndToken = null; } @@ -53,7 +55,7 @@ export class BlockCommentCommand implements editorCommon.ICommand { return true; } - private _createOperationsForBlockComment(selection: Range, startToken: string, endToken: string, model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + private _createOperationsForBlockComment(selection: Range, startToken: string, endToken: string, insertSpace: boolean, model: ITextModel, builder: IEditOperationBuilder): void { const startLineNumber = selection.startLineNumber; const startColumn = selection.startColumn; const endLineNumber = selection.endLineNumber; @@ -91,25 +93,21 @@ export class BlockCommentCommand implements editorCommon.ICommand { if (startTokenIndex !== -1 && endTokenIndex !== -1) { // Consider spaces as part of the comment tokens - if (startTokenIndex + startToken.length < startLineText.length) { - if (startLineText.charCodeAt(startTokenIndex + startToken.length) === CharCode.Space) { - // Pretend the start token contains a trailing space - startToken = startToken + ' '; - } + if (insertSpace && startTokenIndex + startToken.length < startLineText.length && startLineText.charCodeAt(startTokenIndex + startToken.length) === CharCode.Space) { + // Pretend the start token contains a trailing space + startToken = startToken + ' '; } - if (endTokenIndex > 0) { - if (endLineText.charCodeAt(endTokenIndex - 1) === CharCode.Space) { - // Pretend the end token contains a leading space - endToken = ' ' + endToken; - endTokenIndex -= 1; - } + if (insertSpace && endTokenIndex > 0 && endLineText.charCodeAt(endTokenIndex - 1) === CharCode.Space) { + // Pretend the end token contains a leading space + endToken = ' ' + endToken; + endTokenIndex -= 1; } ops = BlockCommentCommand._createRemoveBlockCommentOperations( new Range(startLineNumber, startTokenIndex + startToken.length + 1, endLineNumber, endTokenIndex + 1), startToken, endToken ); } else { - ops = BlockCommentCommand._createAddBlockCommentOperations(selection, startToken, endToken); + ops = BlockCommentCommand._createAddBlockCommentOperations(selection, startToken, endToken, this._insertSpace); this._usedEndToken = ops.length === 1 ? endToken : null; } @@ -144,15 +142,15 @@ export class BlockCommentCommand implements editorCommon.ICommand { return res; } - public static _createAddBlockCommentOperations(r: Range, startToken: string, endToken: string): IIdentifiedSingleEditOperation[] { + public static _createAddBlockCommentOperations(r: Range, startToken: string, endToken: string, insertSpace: boolean): IIdentifiedSingleEditOperation[] { let res: IIdentifiedSingleEditOperation[] = []; if (!Range.isEmpty(r)) { // Insert block comment start - res.push(EditOperation.insert(new Position(r.startLineNumber, r.startColumn), startToken + ' ')); + res.push(EditOperation.insert(new Position(r.startLineNumber, r.startColumn), startToken + (insertSpace ? ' ' : ''))); // Insert block comment end - res.push(EditOperation.insert(new Position(r.endLineNumber, r.endColumn), ' ' + endToken)); + res.push(EditOperation.insert(new Position(r.endLineNumber, r.endColumn), (insertSpace ? ' ' : '') + endToken)); } else { // Insert both continuously res.push(EditOperation.replace(new Range( @@ -164,7 +162,7 @@ export class BlockCommentCommand implements editorCommon.ICommand { return res; } - public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { const startLineNumber = this._selection.startLineNumber; const startColumn = this._selection.startColumn; @@ -176,10 +174,10 @@ export class BlockCommentCommand implements editorCommon.ICommand { return; } - this._createOperationsForBlockComment(this._selection, config.blockCommentStartToken, config.blockCommentEndToken, model, builder); + this._createOperationsForBlockComment(this._selection, config.blockCommentStartToken, config.blockCommentEndToken, this._insertSpace, model, builder); } - public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection { + public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection { const inverseEditOperations = helper.getInverseEditOperations(); if (inverseEditOperations.length === 2) { const startTokenEditOperation = inverseEditOperations[0]; diff --git a/src/vs/editor/contrib/comment/comment.ts b/src/vs/editor/contrib/comment/comment.ts index 301b00677c4..243a45655bf 100644 --- a/src/vs/editor/contrib/comment/comment.ts +++ b/src/vs/editor/contrib/comment/comment.ts @@ -12,6 +12,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { BlockCommentCommand } from 'vs/editor/contrib/comment/blockCommentCommand'; import { LineCommentCommand, Type } from 'vs/editor/contrib/comment/lineCommentCommand'; import { MenuId } from 'vs/platform/actions/common/actions'; +import { EditorOption } from 'vs/editor/common/config/editorOptions'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; abstract class CommentLineAction extends EditorAction { @@ -28,13 +29,14 @@ abstract class CommentLineAction extends EditorAction { return; } - let model = editor.getModel(); - let commands: ICommand[] = []; - let selections = editor.getSelections(); - let opts = model.getOptions(); + const model = editor.getModel(); + const commands: ICommand[] = []; + const selections = editor.getSelections(); + const modelOptions = model.getOptions(); + const commentsOptions = editor.getOption(EditorOption.comments); for (const selection of selections) { - commands.push(new LineCommentCommand(selection, opts.tabSize, this._type)); + commands.push(new LineCommentCommand(selection, modelOptions.tabSize, this._type, commentsOptions.insertSpace)); } editor.pushUndoStop(); @@ -126,10 +128,11 @@ class BlockCommentAction extends EditorAction { return; } - let commands: ICommand[] = []; - let selections = editor.getSelections(); + const commentsOptions = editor.getOption(EditorOption.comments); + const commands: ICommand[] = []; + const selections = editor.getSelections(); for (const selection of selections) { - commands.push(new BlockCommentCommand(selection)); + commands.push(new BlockCommentCommand(selection, commentsOptions.insertSpace)); } editor.pushUndoStop(); diff --git a/src/vs/editor/contrib/comment/lineCommentCommand.ts b/src/vs/editor/contrib/comment/lineCommentCommand.ts index 5c3716ed79c..f266b70380a 100644 --- a/src/vs/editor/contrib/comment/lineCommentCommand.ts +++ b/src/vs/editor/contrib/comment/lineCommentCommand.ts @@ -9,7 +9,7 @@ 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 * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICommand, IEditOperationBuilder, ICursorStateComputerData } from 'vs/editor/common/editorCommon'; import { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { BlockCommentCommand } from 'vs/editor/contrib/comment/blockCommentCommand'; @@ -47,20 +47,22 @@ export const enum Type { ForceRemove = 2 } -export class LineCommentCommand implements editorCommon.ICommand { +export class LineCommentCommand implements ICommand { private readonly _selection: Selection; + private readonly _tabSize: number; + private readonly _type: Type; + private readonly _insertSpace: boolean; private _selectionId: string | null; private _deltaColumn: number; private _moveEndPositionDown: boolean; - private readonly _tabSize: number; - private readonly _type: Type; - constructor(selection: Selection, tabSize: number, type: Type) { + constructor(selection: Selection, tabSize: number, type: Type, insertSpace: boolean) { this._selection = selection; - this._selectionId = null; this._tabSize = tabSize; this._type = type; + this._insertSpace = insertSpace; + this._selectionId = null; this._deltaColumn = 0; this._moveEndPositionDown = false; } @@ -98,7 +100,7 @@ export class LineCommentCommand implements editorCommon.ICommand { * Analyze lines and decide which lines are relevant and what the toggle should do. * Also, build up several offsets and lengths useful in the generation of editor operations. */ - public static _analyzeLines(type: Type, model: ISimpleModel, lines: ILinePreflightData[], startLineNumber: number): IPreflightData { + public static _analyzeLines(type: Type, insertSpace: boolean, model: ISimpleModel, lines: ILinePreflightData[], startLineNumber: number): IPreflightData { let onlyWhitespaceLines = true; let shouldRemoveComments: boolean; @@ -145,7 +147,8 @@ export class LineCommentCommand implements editorCommon.ICommand { } } - if (shouldRemoveComments) { + if (shouldRemoveComments && insertSpace) { + // Remove a following space if present const commentStrEndOffset = lineContentStartOffset + lineData.commentStrLength; if (commentStrEndOffset < lineContent.length && lineContent.charCodeAt(commentStrEndOffset) === CharCode.Space) { lineData.commentStrLength += 1; @@ -173,7 +176,7 @@ export class LineCommentCommand implements editorCommon.ICommand { /** * Analyze all lines and decide exactly what to do => not supported | insert line comments | remove line comments */ - public static _gatherPreflightData(type: Type, model: ITextModel, startLineNumber: number, endLineNumber: number): IPreflightData { + public static _gatherPreflightData(type: Type, insertSpace: boolean, model: ITextModel, startLineNumber: number, endLineNumber: number): IPreflightData { const lines = LineCommentCommand._gatherPreflightCommentStrings(model, startLineNumber, endLineNumber); if (lines === null) { return { @@ -181,13 +184,13 @@ export class LineCommentCommand implements editorCommon.ICommand { }; } - return LineCommentCommand._analyzeLines(type, model, lines, startLineNumber); + return LineCommentCommand._analyzeLines(type, insertSpace, model, lines, startLineNumber); } /** * Given a successful analysis, execute either insert line comments, either remove line comments */ - private _executeLineComments(model: ISimpleModel, builder: editorCommon.IEditOperationBuilder, data: IPreflightDataSupported, s: Selection): void { + private _executeLineComments(model: ISimpleModel, builder: IEditOperationBuilder, data: IPreflightDataSupported, s: Selection): void { let ops: IIdentifiedSingleEditOperation[]; @@ -195,7 +198,7 @@ export class LineCommentCommand implements editorCommon.ICommand { ops = LineCommentCommand._createRemoveLineCommentsOperations(data.lines, s.startLineNumber); } else { LineCommentCommand._normalizeInsertionPoint(model, data.lines, s.startLineNumber, this._tabSize); - ops = LineCommentCommand._createAddLineCommentsOperations(data.lines, s.startLineNumber); + ops = this._createAddLineCommentsOperations(data.lines, s.startLineNumber); } const cursorPosition = new Position(s.positionLineNumber, s.positionColumn); @@ -266,7 +269,7 @@ export class LineCommentCommand implements editorCommon.ICommand { /** * Given an unsuccessful analysis, delegate to the block comment command */ - private _executeBlockComment(model: ITextModel, builder: editorCommon.IEditOperationBuilder, s: Selection): void { + private _executeBlockComment(model: ITextModel, builder: IEditOperationBuilder, s: Selection): void { model.tokenizeIfCheap(s.startLineNumber); let languageId = model.getLanguageIdAtPosition(s.startLineNumber, 1); let config = LanguageConfigurationRegistry.getComments(languageId); @@ -288,11 +291,17 @@ export class LineCommentCommand implements editorCommon.ICommand { firstNonWhitespaceIndex = lineContent.length; } ops = BlockCommentCommand._createAddBlockCommentOperations( - new Range(s.startLineNumber, firstNonWhitespaceIndex + 1, s.startLineNumber, lineContent.length + 1), startToken, endToken + new Range(s.startLineNumber, firstNonWhitespaceIndex + 1, s.startLineNumber, lineContent.length + 1), + startToken, + endToken, + this._insertSpace ); } else { ops = BlockCommentCommand._createAddBlockCommentOperations( - new Range(s.startLineNumber, model.getLineFirstNonWhitespaceColumn(s.startLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), startToken, endToken + new Range(s.startLineNumber, model.getLineFirstNonWhitespaceColumn(s.startLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), + startToken, + endToken, + this._insertSpace ); } @@ -307,7 +316,7 @@ export class LineCommentCommand implements editorCommon.ICommand { } } - public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { let s = this._selection; this._moveEndPositionDown = false; @@ -317,7 +326,7 @@ export class LineCommentCommand implements editorCommon.ICommand { s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); } - const data = LineCommentCommand._gatherPreflightData(this._type, model, s.startLineNumber, s.endLineNumber); + const data = LineCommentCommand._gatherPreflightData(this._type, this._insertSpace, model, s.startLineNumber, s.endLineNumber); if (data.supported) { return this._executeLineComments(model, builder, data, s); } @@ -325,7 +334,7 @@ export class LineCommentCommand implements editorCommon.ICommand { return this._executeBlockComment(model, builder, s); } - public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection { + public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection { let result = helper.getTrackedSelection(this._selectionId!); if (this._moveEndPositionDown) { @@ -365,8 +374,10 @@ export class LineCommentCommand implements editorCommon.ICommand { /** * Generate edit operations in the add line comment case */ - public static _createAddLineCommentsOperations(lines: ILinePreflightData[], startLineNumber: number): IIdentifiedSingleEditOperation[] { + private _createAddLineCommentsOperations(lines: ILinePreflightData[], startLineNumber: number): IIdentifiedSingleEditOperation[] { let res: IIdentifiedSingleEditOperation[] = []; + const afterCommentStr = this._insertSpace ? ' ' : ''; + for (let i = 0, len = lines.length; i < len; i++) { const lineData = lines[i]; @@ -375,13 +386,12 @@ export class LineCommentCommand implements editorCommon.ICommand { continue; } - res.push(EditOperation.insert(new Position(startLineNumber + i, lineData.commentStrOffset + 1), lineData.commentStr + ' ')); + res.push(EditOperation.insert(new Position(startLineNumber + i, lineData.commentStrOffset + 1), lineData.commentStr + afterCommentStr)); } return res; } - // TODO@Alex -> duplicated in characterHardWrappingLineMapper private static nextVisibleColumn(currentVisibleColumn: number, tabSize: number, isTab: boolean, columnSize: number): number { if (isTab) { return currentVisibleColumn + (tabSize - (currentVisibleColumn % tabSize)); diff --git a/src/vs/editor/contrib/comment/test/blockCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/blockCommentCommand.test.ts index 8576680d71b..19a5be49ffb 100644 --- a/src/vs/editor/contrib/comment/test/blockCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/blockCommentCommand.test.ts @@ -9,7 +9,7 @@ import { CommentMode } from 'vs/editor/test/common/commentMode'; function testBlockCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { let mode = new CommentMode({ lineComment: '!@#', blockComment: ['<0', '0>'] }); - testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new BlockCommentCommand(sel), expectedLines, expectedSelection); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new BlockCommentCommand(sel, true), expectedLines, expectedSelection); mode.dispose(); } @@ -468,4 +468,45 @@ suite('Editor Contrib - Block Comment Command', () => { new Selection(1, 1, 1, 1) ); }); + + test('', () => { + }); + + test('insertSpace false', () => { + function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + let mode = new CommentMode({ lineComment: '!@#', blockComment: ['<0', '0>'] }); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new BlockCommentCommand(sel, false), expectedLines, expectedSelection); + mode.dispose(); + } + + testLineCommentCommand( + [ + 'some text' + ], + new Selection(1, 1, 1, 5), + [ + '<0some0> text' + ], + new Selection(1, 3, 1, 7) + ); + }); + + test('insertSpace false does not remove space', () => { + function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + let mode = new CommentMode({ lineComment: '!@#', blockComment: ['<0', '0>'] }); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new BlockCommentCommand(sel, false), expectedLines, expectedSelection); + mode.dispose(); + } + + testLineCommentCommand( + [ + '<0 some 0> text' + ], + new Selection(1, 4, 1, 8), + [ + ' some text' + ], + new Selection(1, 1, 1, 7) + ); + }); }); diff --git a/src/vs/editor/contrib/comment/test/lineCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/lineCommentCommand.test.ts index 5f8b23c6ed7..66593786b96 100644 --- a/src/vs/editor/contrib/comment/test/lineCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/lineCommentCommand.test.ts @@ -2,6 +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 assert from 'assert'; import { Selection } from 'vs/editor/common/core/selection'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; @@ -18,13 +19,13 @@ suite('Editor Contrib - Line Comment Command', () => { function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { let mode = new CommentMode({ lineComment: '!@#', blockComment: [''] }); - testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle), expectedLines, expectedSelection); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle, true), expectedLines, expectedSelection); mode.dispose(); } function testAddLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { let mode = new CommentMode({ lineComment: '!@#', blockComment: [''] }); - testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.ForceAdd), expectedLines, expectedSelection); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.ForceAdd, true), expectedLines, expectedSelection); mode.dispose(); } @@ -46,7 +47,7 @@ suite('Editor Contrib - Line Comment Command', () => { test('case insensitive', function () { function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { let mode = new CommentMode({ lineComment: 'rem' }); - testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle), expectedLines, expectedSelection); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle, true), expectedLines, expectedSelection); mode.dispose(); } @@ -85,7 +86,7 @@ suite('Editor Contrib - Line Comment Command', () => { test('_analyzeLines', () => { let r: IPreflightData; - r = LineCommentCommand._analyzeLines(Type.Toggle, createSimpleModel([ + r = LineCommentCommand._analyzeLines(Type.Toggle, true, createSimpleModel([ '\t\t', ' ', ' c', @@ -116,7 +117,7 @@ suite('Editor Contrib - Line Comment Command', () => { assert.equal(r.lines[3].commentStrOffset, 2); - r = LineCommentCommand._analyzeLines(Type.Toggle, createSimpleModel([ + r = LineCommentCommand._analyzeLines(Type.Toggle, true, createSimpleModel([ '\t\t', ' rem ', ' !@# c', @@ -626,13 +627,51 @@ suite('Editor Contrib - Line Comment Command', () => { new Selection(2, 11, 1, 1) ); }); + + test('insertSpace false', () => { + function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + let mode = new CommentMode({ lineComment: '!@#' }); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle, false), expectedLines, expectedSelection); + mode.dispose(); + } + + testLineCommentCommand( + [ + 'some text' + ], + new Selection(1, 1, 1, 1), + [ + '!@#some text' + ], + new Selection(1, 4, 1, 4) + ); + }); + + test('insertSpace false does not remove space', () => { + function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + let mode = new CommentMode({ lineComment: '!@#' }); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle, false), expectedLines, expectedSelection); + mode.dispose(); + } + + testLineCommentCommand( + [ + '!@# some text' + ], + new Selection(1, 1, 1, 1), + [ + ' some text' + ], + new Selection(1, 1, 1, 1) + ); + }); }); suite('Editor Contrib - Line Comment As Block Comment', () => { function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { let mode = new CommentMode({ lineComment: '', blockComment: ['(', ')'] }); - testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle), expectedLines, expectedSelection); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle, true), expectedLines, expectedSelection); mode.dispose(); } @@ -743,7 +782,7 @@ suite('Editor Contrib - Line Comment As Block Comment', () => { suite('Editor Contrib - Line Comment As Block Comment 2', () => { function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { let mode = new CommentMode({ lineComment: null, blockComment: [''] }); - testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle), expectedLines, expectedSelection); + testCommand(lines, mode.getLanguageIdentifier(), selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle, true), expectedLines, expectedSelection); mode.dispose(); } @@ -984,7 +1023,7 @@ suite('Editor Contrib - Line Comment in mixed modes', () => { lines, outerMode.getLanguageIdentifier(), selection, - (sel) => new LineCommentCommand(sel, 4, Type.Toggle), + (sel) => new LineCommentCommand(sel, 4, Type.Toggle, true), expectedLines, expectedSelection, true diff --git a/src/vs/editor/contrib/cursorUndo/cursorUndo.ts b/src/vs/editor/contrib/cursorUndo/cursorUndo.ts index aecd7026498..c23dea3649b 100644 --- a/src/vs/editor/contrib/cursorUndo/cursorUndo.ts +++ b/src/vs/editor/contrib/cursorUndo/cursorUndo.ts @@ -9,7 +9,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { Selection } from 'vs/editor/common/core/selection'; -import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -35,6 +35,14 @@ class CursorState { } } +class StackElement { + constructor( + public readonly cursorState: CursorState, + public readonly scrollTop: number, + public readonly scrollLeft: number + ) { } +} + export class CursorUndoRedoController extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.cursorUndoRedoController'; @@ -46,8 +54,8 @@ export class CursorUndoRedoController extends Disposable implements IEditorContr private readonly _editor: ICodeEditor; private _isCursorUndoRedo: boolean; - private _undoStack: CursorState[]; - private _redoStack: CursorState[]; + private _undoStack: StackElement[]; + private _redoStack: StackElement[]; constructor(editor: ICodeEditor) { super(); @@ -76,9 +84,9 @@ export class CursorUndoRedoController extends Disposable implements IEditorContr return; } const prevState = new CursorState(e.oldSelections); - const isEqualToLastUndoStack = (this._undoStack.length > 0 && this._undoStack[this._undoStack.length - 1].equals(prevState)); + const isEqualToLastUndoStack = (this._undoStack.length > 0 && this._undoStack[this._undoStack.length - 1].cursorState.equals(prevState)); if (!isEqualToLastUndoStack) { - this._undoStack.push(prevState); + this._undoStack.push(new StackElement(prevState, editor.getScrollTop(), editor.getScrollLeft())); this._redoStack = []; if (this._undoStack.length > 50) { // keep the cursor undo stack bounded @@ -93,7 +101,7 @@ export class CursorUndoRedoController extends Disposable implements IEditorContr return; } - this._redoStack.push(new CursorState(this._editor.getSelections())); + this._redoStack.push(new StackElement(new CursorState(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())); this._applyState(this._undoStack.pop()!); } @@ -102,14 +110,17 @@ export class CursorUndoRedoController extends Disposable implements IEditorContr return; } - this._undoStack.push(new CursorState(this._editor.getSelections())); + this._undoStack.push(new StackElement(new CursorState(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())); this._applyState(this._redoStack.pop()!); } - private _applyState(state: CursorState): void { + private _applyState(stackElement: StackElement): void { this._isCursorUndoRedo = true; - this._editor.setSelections(state.selections); - this._editor.revealRangeInCenterIfOutsideViewport(state.selections[0], ScrollType.Smooth); + this._editor.setSelections(stackElement.cursorState.selections); + this._editor.setScrollPosition({ + scrollTop: stackElement.scrollTop, + scrollLeft: stackElement.scrollLeft + }); this._isCursorUndoRedo = false; } } diff --git a/src/vs/editor/contrib/dnd/dnd.ts b/src/vs/editor/contrib/dnd/dnd.ts index 6d4226cbe5e..ea3cda654bc 100644 --- a/src/vs/editor/contrib/dnd/dnd.ts +++ b/src/vs/editor/contrib/dnd/dnd.ts @@ -10,7 +10,7 @@ import { isMacintosh } from 'vs/base/common/platform'; import { KeyCode } from 'vs/base/common/keyCodes'; import { ICodeEditor, IEditorMouseEvent, IMouseTarget, MouseTargetType, IPartialEditorMouseEvent } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; @@ -29,7 +29,7 @@ function hasTriggerModifier(e: IKeyboardEvent | IMouseEvent): boolean { } } -export class DragAndDropController extends Disposable implements editorCommon.IEditorContribution { +export class DragAndDropController extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.dragAndDrop'; @@ -201,7 +201,7 @@ export class DragAndDropController extends Disposable implements editorCommon.IE }]; this._dndDecorationIds = this._editor.deltaDecorations(this._dndDecorationIds, newDecorations); - this._editor.revealPosition(position, editorCommon.ScrollType.Immediate); + this._editor.revealPosition(position, ScrollType.Immediate); } private _removeDecoration(): void { diff --git a/src/vs/editor/contrib/dnd/dragAndDropCommand.ts b/src/vs/editor/contrib/dnd/dragAndDropCommand.ts index 8d1d8a32b02..e6d7b427ae5 100644 --- a/src/vs/editor/contrib/dnd/dragAndDropCommand.ts +++ b/src/vs/editor/contrib/dnd/dragAndDropCommand.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICommand, IEditOperationBuilder, ICursorStateComputerData } from 'vs/editor/common/editorCommon'; import { Selection } from 'vs/editor/common/core/selection'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { ITextModel } from 'vs/editor/common/model'; -export class DragAndDropCommand implements editorCommon.ICommand { +export class DragAndDropCommand implements ICommand { private readonly selection: Selection; private readonly targetPosition: Position; @@ -24,7 +24,7 @@ export class DragAndDropCommand implements editorCommon.ICommand { this.targetSelection = null; } - public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { let text = model.getValueInRange(this.selection); if (!this.copy) { builder.addEditOperation(this.selection, null); @@ -102,7 +102,7 @@ export class DragAndDropCommand implements editorCommon.ICommand { } } - public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection { + public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection { return this.targetSelection!; } } diff --git a/src/vs/editor/contrib/find/findController.ts b/src/vs/editor/contrib/find/findController.ts index fbd9bf5500b..fee09b8429d 100644 --- a/src/vs/editor/contrib/find/findController.ts +++ b/src/vs/editor/contrib/find/findController.ts @@ -10,7 +10,7 @@ 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, ServicesAccessor, registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_FIND_WIDGET_VISIBLE, FIND_IDS, FindModelBoundToEditorModel, ToggleCaseSensitiveKeybinding, ToggleRegexKeybinding, ToggleSearchScopeKeybinding, ToggleWholeWordKeybinding, CONTEXT_REPLACE_INPUT_FOCUSED } from 'vs/editor/contrib/find/findModel'; import { FindOptionsWidget } from 'vs/editor/contrib/find/findOptionsWidget'; @@ -68,7 +68,7 @@ export interface IFindStartOptions { updateSearchScope: boolean; } -export class CommonFindController extends Disposable implements editorCommon.IEditorContribution { +export class CommonFindController extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.findController'; diff --git a/src/vs/editor/contrib/find/findModel.ts b/src/vs/editor/contrib/find/findModel.ts index da67f86eb78..0653ac4f5c4 100644 --- a/src/vs/editor/contrib/find/findModel.ts +++ b/src/vs/editor/contrib/find/findModel.ts @@ -13,7 +13,7 @@ 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 { Constants } from 'vs/base/common/uint'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { ScrollType, ICommand } 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/findDecorations'; @@ -209,7 +209,7 @@ export class FindModelBoundToEditorModel { let findScope = this._decorations.getFindScope(); if (findScope) { // Reveal the selection so user is reminded that 'selection find' is on. - this._editor.revealRangeInCenterIfOutsideViewport(findScope, editorCommon.ScrollType.Smooth); + this._editor.revealRangeInCenterIfOutsideViewport(findScope, ScrollType.Smooth); } return true; } @@ -225,7 +225,7 @@ export class FindModelBoundToEditorModel { ); this._editor.setSelection(match); - this._editor.revealRangeInCenterIfOutsideViewport(match, editorCommon.ScrollType.Smooth); + this._editor.revealRangeInCenterIfOutsideViewport(match, ScrollType.Smooth); } private _prevSearchPosition(before: Position) { @@ -536,7 +536,7 @@ export class FindModelBoundToEditorModel { this._editor.setSelections(selections); } - private _executeEditorCommand(source: string, command: editorCommon.ICommand): void { + private _executeEditorCommand(source: string, command: ICommand): void { try { this._ignoreModelContentChanged = true; this._editor.pushUndoStop(); diff --git a/src/vs/editor/contrib/find/replaceAllCommand.ts b/src/vs/editor/contrib/find/replaceAllCommand.ts index bdf2942f014..fb2de090a52 100644 --- a/src/vs/editor/contrib/find/replaceAllCommand.ts +++ b/src/vs/editor/contrib/find/replaceAllCommand.ts @@ -5,7 +5,7 @@ import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICommand, IEditOperationBuilder, ICursorStateComputerData } from 'vs/editor/common/editorCommon'; import { ITextModel } from 'vs/editor/common/model'; interface IEditOperation { @@ -13,7 +13,7 @@ interface IEditOperation { text: string; } -export class ReplaceAllCommand implements editorCommon.ICommand { +export class ReplaceAllCommand implements ICommand { private readonly _editorSelection: Selection; private _trackedEditorSelectionId: string | null; @@ -27,7 +27,7 @@ export class ReplaceAllCommand implements editorCommon.ICommand { this._trackedEditorSelectionId = null; } - public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { if (this._ranges.length > 0) { // Collect all edit operations let ops: IEditOperation[] = []; @@ -66,7 +66,7 @@ export class ReplaceAllCommand implements editorCommon.ICommand { this._trackedEditorSelectionId = builder.trackSelection(this._editorSelection); } - public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection { + public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection { return helper.getTrackedSelection(this._trackedEditorSelectionId!); } } diff --git a/src/vs/editor/contrib/format/format.ts b/src/vs/editor/contrib/format/format.ts index 58602a5bfaf..8747d4bc17b 100644 --- a/src/vs/editor/contrib/format/format.ts +++ b/src/vs/editor/contrib/format/format.ts @@ -14,7 +14,7 @@ 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 * as editorCommon from 'vs/editor/common/editorCommon'; +import { ScrollType } from 'vs/editor/common/editorCommon'; import { ISingleEditOperation, ITextModel } from 'vs/editor/common/model'; import { DocumentFormattingEditProvider, DocumentFormattingEditProviderRegistry, DocumentRangeFormattingEditProvider, DocumentRangeFormattingEditProviderRegistry, FormattingOptions, OnTypeFormattingEditProviderRegistry, TextEdit } from 'vs/editor/common/modes'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; @@ -181,8 +181,7 @@ export async function formatDocumentRangeWithProvider( FormattingEdit.execute(editorOrModel, edits); alertFormattingEdits(edits); editorOrModel.pushUndoStop(); - editorOrModel.focus(); - editorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), editorCommon.ScrollType.Immediate); + editorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), ScrollType.Immediate); } else { // use model to apply edits @@ -271,8 +270,7 @@ export async function formatDocumentWithProvider( if (mode !== FormattingMode.Silent) { alertFormattingEdits(edits); editorOrModel.pushUndoStop(); - editorOrModel.focus(); - editorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), editorCommon.ScrollType.Immediate); + editorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), ScrollType.Immediate); } } else { diff --git a/src/vs/editor/contrib/format/formatActions.ts b/src/vs/editor/contrib/format/formatActions.ts index 879000c9140..219308c8467 100644 --- a/src/vs/editor/contrib/format/formatActions.ts +++ b/src/vs/editor/contrib/format/formatActions.ts @@ -12,7 +12,7 @@ import { EditorAction, registerEditorAction, registerEditorContribution, Service import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { CharacterSet } from 'vs/editor/common/core/characterClassifier'; import { Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { DocumentRangeFormattingEditProviderRegistry, OnTypeFormattingEditProviderRegistry } from 'vs/editor/common/modes'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; @@ -26,7 +26,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { onUnexpectedError } from 'vs/base/common/errors'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; -class FormatOnType implements editorCommon.IEditorContribution { +class FormatOnType implements IEditorContribution { public static readonly ID = 'editor.contrib.autoFormat'; @@ -149,7 +149,7 @@ class FormatOnType implements editorCommon.IEditorContribution { } } -class FormatOnPaste implements editorCommon.IEditorContribution { +class FormatOnPaste implements IEditorContribution { public static readonly ID = 'editor.contrib.formatOnPaste'; @@ -191,7 +191,7 @@ class FormatOnPaste implements editorCommon.IEditorContribution { return; } - this._callOnModel.add(this.editor.onDidPaste(range => this._trigger(range))); + this._callOnModel.add(this.editor.onDidPaste(({ range }) => this._trigger(range))); } private _trigger(range: Range): void { diff --git a/src/vs/editor/contrib/gotoError/gotoError.ts b/src/vs/editor/contrib/gotoError/gotoError.ts index 11e2b470510..5ac29409f1c 100644 --- a/src/vs/editor/contrib/gotoError/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/gotoError.ts @@ -12,7 +12,7 @@ import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/cont import { IMarker, IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { registerEditorAction, registerEditorContribution, ServicesAccessor, IActionOptions, EditorAction, EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -27,6 +27,7 @@ import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { Action } from 'vs/base/common/actions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { isEqual } from 'vs/base/common/resources'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; class MarkerModel { @@ -189,7 +190,7 @@ class MarkerModel { } } -export class MarkerController implements editorCommon.IEditorContribution { +export class MarkerController implements IEditorContribution { public static readonly ID = 'editor.contrib.markerController'; @@ -209,7 +210,8 @@ export class MarkerController implements editorCommon.IEditorContribution { @IContextKeyService private readonly _contextKeyService: IContextKeyService, @IThemeService private readonly _themeService: IThemeService, @ICodeEditorService private readonly _editorService: ICodeEditorService, - @IKeybindingService private readonly _keybindingService: IKeybindingService + @IKeybindingService private readonly _keybindingService: IKeybindingService, + @IOpenerService private readonly _openerService: IOpenerService ) { this._editor = editor; this._widgetVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService); @@ -243,7 +245,7 @@ export class MarkerController implements editorCommon.IEditorContribution { new Action(NextMarkerAction.ID, NextMarkerAction.LABEL + (nextMarkerKeybinding ? ` (${nextMarkerKeybinding.getLabel()})` : ''), 'show-next-problem codicon-chevron-down', this._model.canNavigate(), async () => { if (this._model) { this._model.move(true, true); } }), new Action(PrevMarkerAction.ID, PrevMarkerAction.LABEL + (prevMarkerKeybinding ? ` (${prevMarkerKeybinding.getLabel()})` : ''), 'show-previous-problem codicon-chevron-up', this._model.canNavigate(), async () => { if (this._model) { this._model.move(false, true); } }) ]; - this._widget = new MarkerNavigationWidget(this._editor, actions, this._themeService); + this._widget = new MarkerNavigationWidget(this._editor, actions, this._themeService, this._openerService); this._widgetVisible.set(true); this._widget.onDidClose(() => this.closeMarkersNavigation(), this, this._disposeOnClose); diff --git a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts index 0926872fc13..7cbc0b2e504 100644 --- a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts +++ b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts @@ -26,6 +26,7 @@ import { IAction } from 'vs/base/common/actions'; import { IActionBarOptions, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; import { SeverityIcon } from 'vs/platform/severityIcon/common/severityIcon'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; class MessageWidget { @@ -39,7 +40,14 @@ class MessageWidget { private readonly _relatedDiagnostics = new WeakMap(); private readonly _disposables: DisposableStore = new DisposableStore(); - constructor(parent: HTMLElement, editor: ICodeEditor, onRelatedInformation: (related: IRelatedInformation) => void) { + private _codeLink?: HTMLElement; + + constructor( + parent: HTMLElement, + editor: ICodeEditor, + onRelatedInformation: (related: IRelatedInformation) => void, + private readonly _openerService: IOpenerService, + ) { this._editor = editor; const domNode = document.createElement('div'); @@ -81,12 +89,20 @@ class MessageWidget { } update({ source, message, relatedInformation, code }: IMarker): void { + let sourceAndCodeLength = (source?.length || 0) + '()'.length; + if (code) { + if (typeof code === 'string') { + sourceAndCodeLength += code.length; + } else { + sourceAndCodeLength += code.value.length; + } + } const lines = message.split(/\r\n|\r|\n/g); this._lines = lines.length; this._longestLineLength = 0; for (const line of lines) { - this._longestLineLength = Math.max(line.length, this._longestLineLength); + this._longestLineLength = Math.max(line.length + sourceAndCodeLength, this._longestLineLength); } dom.clearNode(this._messageBlock); @@ -111,10 +127,25 @@ class MessageWidget { detailsElement.appendChild(sourceElement); } if (code) { - const codeElement = document.createElement('span'); - codeElement.innerText = `(${code})`; - dom.addClass(codeElement, 'code'); - detailsElement.appendChild(codeElement); + if (typeof code === 'string') { + const codeElement = document.createElement('span'); + codeElement.innerText = `(${code})`; + dom.addClass(codeElement, 'code'); + detailsElement.appendChild(codeElement); + } else { + this._codeLink = dom.$('a.code-link'); + this._codeLink.setAttribute('href', `${code.link.toString()}`); + + this._codeLink.onclick = (e) => { + this._openerService.open(code.link); + e.preventDefault(); + e.stopPropagation(); + }; + + const codeElement = dom.append(this._codeLink, dom.$('span')); + codeElement.innerText = code.value; + detailsElement.appendChild(this._codeLink); + } } } @@ -180,7 +211,8 @@ export class MarkerNavigationWidget extends PeekViewWidget { constructor( editor: ICodeEditor, private readonly actions: ReadonlyArray, - private readonly _themeService: IThemeService + private readonly _themeService: IThemeService, + private readonly _openerService: IOpenerService ) { super(editor, { showArrow: true, showFrame: true, isAccessible: true }); this._severity = MarkerSeverity.Warning; @@ -250,7 +282,7 @@ export class MarkerNavigationWidget extends PeekViewWidget { this._container = document.createElement('div'); container.appendChild(this._container); - this._message = new MessageWidget(this._container, this.editor, related => this._onDidSelectRelatedInformation.fire(related)); + this._message = new MessageWidget(this._container, this.editor, related => this._onDidSelectRelatedInformation.fire(related), this._openerService); this._disposables.add(this._message); } @@ -329,8 +361,9 @@ export const editorMarkerNavigationInfo = registerColor('editorMarkerNavigationI export const editorMarkerNavigationBackground = registerColor('editorMarkerNavigation.background', { dark: '#2D2D30', light: Color.white, hc: '#0C141F' }, nls.localize('editorMarkerNavigationBackground', 'Editor marker navigation widget background.')); registerThemingParticipant((theme, collector) => { - const link = theme.getColor(textLinkForeground); - if (link) { - collector.addRule(`.monaco-editor .marker-widget a { color: ${link}; }`); + const linkFg = theme.getColor(textLinkForeground); + if (linkFg) { + collector.addRule(`.monaco-editor .marker-widget a { color: ${linkFg}; }`); + collector.addRule(`.monaco-editor .marker-widget a.code-link span:hover { color: ${linkFg}; }`); } }); diff --git a/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css b/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css index ee02594a087..c748c365bdc 100644 --- a/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css +++ b/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css @@ -45,10 +45,27 @@ } .monaco-editor .marker-widget .descriptioncontainer .message .source, -.monaco-editor .marker-widget .descriptioncontainer .message .code { +.monaco-editor .marker-widget .descriptioncontainer .message span.code { opacity: 0.6; } +.monaco-editor .marker-widget .descriptioncontainer .message a.code-link { + opacity: 0.6; + color: inherit; +} +.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before { + content: '('; +} +.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after { + content: ')'; +} +.monaco-editor .marker-widget .descriptioncontainer .message a.code-link > span { + text-decoration: underline; + /** Hack to force underline to show **/ + border-bottom: 1px solid transparent; + text-underline-position: under; +} + .monaco-editor .marker-widget .descriptioncontainer .filename { cursor: pointer; } diff --git a/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts b/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts index 240bf4c52df..d3678e527d9 100644 --- a/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts +++ b/src/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.ts @@ -11,7 +11,7 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { MarkdownString } from 'vs/base/common/htmlContent'; import { IModeService } from 'vs/editor/common/services/modeService'; import { Range, IRange } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { DefinitionProviderRegistry, LocationLink } from 'vs/editor/common/modes'; import { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; @@ -28,7 +28,7 @@ import { Position } from 'vs/editor/common/core/position'; import { withNullAsUndefined } from 'vs/base/common/types'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -export class GotoDefinitionAtPositionEditorContribution implements editorCommon.IEditorContribution { +export class GotoDefinitionAtPositionEditorContribution implements IEditorContribution { public static readonly ID = 'editor.contrib.gotodefinitionatposition'; static readonly MAX_SOURCE_PREVIEW_LINES = 8; diff --git a/src/vs/editor/contrib/gotoSymbol/peek/referencesController.ts b/src/vs/editor/contrib/gotoSymbol/peek/referencesController.ts index 969f5e09d5d..450930c957f 100644 --- a/src/vs/editor/contrib/gotoSymbol/peek/referencesController.ts +++ b/src/vs/editor/contrib/gotoSymbol/peek/referencesController.ts @@ -11,7 +11,7 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati import { IContextKey, IContextKeyService, RawContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { ReferencesModel, OneReference } from '../referencesModel'; import { ReferenceWidget, LayoutData } from './referencesWidget'; @@ -25,10 +25,11 @@ import { IListService, WorkbenchListFocusContextKey } from 'vs/platform/list/bro import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { EditorOption } from 'vs/editor/common/config/editorOptions'; export const ctxReferenceSearchVisible = new RawContextKey('referenceSearchVisible', false); -export abstract class ReferencesController implements editorCommon.IEditorContribution { +export abstract class ReferencesController implements IEditorContribution { static readonly ID = 'editor.contrib.referencesController'; @@ -163,7 +164,11 @@ export abstract class ReferencesController implements editorCommon.IEditorContri let pos = new Position(range.startLineNumber, range.startColumn); let selection = this._model.nearestReference(uri, pos); if (selection) { - return this._widget.setSelection(selection); + return this._widget.setSelection(selection).then(() => { + if (this._widget && this._editor.getOption(EditorOption.peekWidgetDefaultFocus) === 'editor') { + this._widget.focusOnPreviewEditor(); + } + }); } } return undefined; @@ -201,10 +206,13 @@ export abstract class ReferencesController implements editorCommon.IEditorContri } const target = this._model.nextOrPreviousReference(source, fwd); const editorFocus = this._editor.hasTextFocus(); + const previewEditorFocus = this._widget.isPreviewEditorFocused(); await this._widget.setSelection(target); await this._gotoReference(target); if (editorFocus) { this._editor.focus(); + } else if (this._widget && previewEditorFocus) { + this._widget.focusOnPreviewEditor(); } } @@ -292,8 +300,8 @@ function withController(accessor: ServicesAccessor, fn: (controller: ReferencesC } KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'changePeekFocus', - weight: KeybindingWeight.WorkbenchContrib + 50, + id: 'togglePeekWidgetFocus', + weight: KeybindingWeight.EditorContrib, primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.F2), when: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor), handler(accessor) { @@ -305,7 +313,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'goToNextReference', - weight: KeybindingWeight.WorkbenchContrib + 50, + weight: KeybindingWeight.EditorContrib - 10, primary: KeyCode.F4, secondary: [KeyCode.F12], when: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor), @@ -318,7 +326,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'goToPreviousReference', - weight: KeybindingWeight.WorkbenchContrib + 50, + weight: KeybindingWeight.EditorContrib - 10, primary: KeyMod.Shift | KeyCode.F4, secondary: [KeyMod.Shift | KeyCode.F12], when: ContextKeyExpr.or(ctxReferenceSearchVisible, PeekContext.inPeekEditor), diff --git a/src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts b/src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts index 10211eb0abc..f4d1f08555b 100644 --- a/src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts +++ b/src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts @@ -17,7 +17,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IRange, Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +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/modes'; @@ -247,7 +247,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget { } show(where: IRange) { - this.editor.revealRangeInCenterIfOutsideViewport(where, editorCommon.ScrollType.Smooth); + this.editor.revealRangeInCenterIfOutsideViewport(where, ScrollType.Smooth); super.show(where, this.layoutData.heightInLines || 18); } @@ -526,7 +526,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget { // show in editor const model = ref.object; if (model) { - const scrollType = this._preview.getModel() === model.textEditorModel ? editorCommon.ScrollType.Smooth : editorCommon.ScrollType.Immediate; + const scrollType = this._preview.getModel() === model.textEditorModel ? ScrollType.Smooth : ScrollType.Immediate; const sel = Range.lift(reference.range).collapseToStart(); this._previewModelReference = ref; this._preview.setModel(model.textEditorModel); diff --git a/src/vs/editor/contrib/hover/hover.css b/src/vs/editor/contrib/hover/hover.css index 19f7bcec136..8f35b9aec75 100644 --- a/src/vs/editor/contrib/hover/hover.css +++ b/src/vs/editor/contrib/hover/hover.css @@ -110,3 +110,20 @@ font-size: inherit; vertical-align: middle; } + +.monaco-editor-hover .hover-contents a.code-link:before { + content: '('; +} +.monaco-editor-hover .hover-contents a.code-link:after { + content: ')'; +} + +.monaco-editor-hover .hover-contents a.code-link { + color: inherit; +} +.monaco-editor-hover .hover-contents a.code-link > span { + text-decoration: underline; + /** Hack to force underline to show **/ + border-bottom: 1px solid transparent; + text-underline-position: under; +} diff --git a/src/vs/editor/contrib/hover/modesContentHover.ts b/src/vs/editor/contrib/hover/modesContentHover.ts index 63fd6053301..7a3ed0db358 100644 --- a/src/vs/editor/contrib/hover/modesContentHover.ts +++ b/src/vs/editor/contrib/hover/modesContentHover.ts @@ -13,7 +13,7 @@ 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 { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { DocumentColorProvider, Hover as MarkdownHover, HoverProviderRegistry, IColor, TokenizationRegistry } from 'vs/editor/common/modes'; +import { DocumentColorProvider, Hover as MarkdownHover, HoverProviderRegistry, IColor, TokenizationRegistry, CodeActionTriggerType } from 'vs/editor/common/modes'; import { getColorPresentations } from 'vs/editor/contrib/colorPicker/color'; import { ColorDetector } from 'vs/editor/contrib/colorPicker/colorDetector'; import { ColorPickerModel } from 'vs/editor/contrib/colorPicker/colorPickerModel'; @@ -22,7 +22,7 @@ import { getHover } from 'vs/editor/contrib/hover/getHover'; import { HoverOperation, HoverStartMode, IHoverComputer } from 'vs/editor/contrib/hover/hoverOperation'; import { ContentHoverWidget } from 'vs/editor/contrib/hover/hoverWidgets'; import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { coalesce, isNonEmptyArray, asArray } from 'vs/base/common/arrays'; import { IMarker, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { basename } from 'vs/base/common/resources'; @@ -34,11 +34,12 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; import { getCodeActions, CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction'; import { QuickFixAction, QuickFixController } from 'vs/editor/contrib/codeAction/codeActionCommands'; -import { CodeActionKind } from 'vs/editor/contrib/codeAction/types'; +import { CodeActionKind, CodeActionTrigger } from 'vs/editor/contrib/codeAction/types'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IIdentifiedSingleEditOperation } from 'vs/editor/common/model'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; import { Constants } from 'vs/base/common/uint'; +import { textLinkForeground } from 'vs/platform/theme/common/colorRegistry'; const $ = dom.$; @@ -186,6 +187,11 @@ class ModesContentComputer implements IHoverComputer { } } +const markerCodeActionTrigger: CodeActionTrigger = { + type: CodeActionTriggerType.Manual, + filter: { include: CodeActionKind.QuickFix } +}; + export class ModesContentHoverWidget extends ContentHoverWidget { static readonly ID = 'editor.contrib.modesContentHoverWidget'; @@ -199,6 +205,8 @@ export class ModesContentHoverWidget extends ContentHoverWidget { private _shouldFocus: boolean; private _colorPicker: ColorPickerWidget | null; + private _codeLink?: HTMLElement; + private readonly renderDisposable = this._register(new MutableDisposable()); constructor( @@ -495,10 +503,35 @@ export class ModesContentHoverWidget extends ContentHoverWidget { messageElement.innerText = message; if (source || code) { - const detailsElement = dom.append(markerElement, $('span')); - detailsElement.style.opacity = '0.6'; - detailsElement.style.paddingLeft = '6px'; - detailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`; + if (typeof code === 'string') { + const detailsElement = dom.append(markerElement, $('span')); + detailsElement.style.opacity = '0.6'; + detailsElement.style.paddingLeft = '6px'; + detailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`; + } else { + if (code) { + const sourceAndCodeElement = $('span'); + if (source) { + const sourceElement = dom.append(sourceAndCodeElement, $('span')); + sourceElement.innerText = source; + } + this._codeLink = dom.append(sourceAndCodeElement, $('a.code-link')); + this._codeLink.setAttribute('href', code.link.toString()); + + this._codeLink.onclick = (e) => { + this._openerService.open(code.link); + e.preventDefault(); + e.stopPropagation(); + }; + + const codeElement = dom.append(this._codeLink, $('span')); + codeElement.innerText = code.value; + + const detailsElement = dom.append(markerElement, sourceAndCodeElement); + detailsElement.style.opacity = '0.6'; + detailsElement.style.paddingLeft = '6px'; + } + } } if (isNonEmptyArray(relatedInformation)) { @@ -575,7 +608,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget { showing = true; const controller = QuickFixController.get(this._editor); const elementPosition = dom.getDomNodePagePosition(target); - controller.showCodeActions(actions, { + controller.showCodeActions(markerCodeActionTrigger, actions, { x: elementPosition.left + 6, y: elementPosition.top + elementPosition.height + 6 }); @@ -592,7 +625,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget { return getCodeActions( this._editor.getModel()!, new Range(marker.startLineNumber, marker.startColumn, marker.endLineNumber, marker.endColumn), - { type: 'manual', filter: { include: CodeActionKind.QuickFix } }, + markerCodeActionTrigger, cancellationToken); }); } @@ -643,3 +676,11 @@ function hoverContentsEquals(first: HoverPart[], second: HoverPart[]): boolean { } return true; } + +registerThemingParticipant((theme, collector) => { + const linkFg = theme.getColor(textLinkForeground); + if (linkFg) { + collector.addRule(`.monaco-editor-hover .hover-contents a.code-link span:hover { color: ${linkFg}; }`); + } +}); + diff --git a/src/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.ts b/src/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.ts index a64be8e0109..0d069f4f6c3 100644 --- a/src/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.ts +++ b/src/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { Selection } from 'vs/editor/common/core/selection'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICommand, IEditOperationBuilder, ICursorStateComputerData } from 'vs/editor/common/editorCommon'; import { Range } from 'vs/editor/common/core/range'; import { ITextModel } from 'vs/editor/common/model'; -export class InPlaceReplaceCommand implements editorCommon.ICommand { +export class InPlaceReplaceCommand implements ICommand { private readonly _editRange: Range; private readonly _originalSelection: Selection; @@ -20,11 +20,11 @@ export class InPlaceReplaceCommand implements editorCommon.ICommand { this._text = text; } - public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { builder.addTrackedEditOperation(this._editRange, this._text); } - public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection { + public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection { const inverseEditOperations = helper.getInverseEditOperations(); const srcRange = inverseEditOperations[0].range; diff --git a/src/vs/editor/contrib/indentation/indentation.ts b/src/vs/editor/contrib/indentation/indentation.ts index e20fa833c5f..20280edd604 100644 --- a/src/vs/editor/contrib/indentation/indentation.ts +++ b/src/vs/editor/contrib/indentation/indentation.ts @@ -451,7 +451,7 @@ export class AutoIndentOnPaste implements IEditorContribution { return; } - this.callOnModel.add(this.editor.onDidPaste((range: Range) => { + this.callOnModel.add(this.editor.onDidPaste(({ range }) => { this.trigger(range); })); } diff --git a/src/vs/editor/contrib/linesOperations/copyLinesCommand.ts b/src/vs/editor/contrib/linesOperations/copyLinesCommand.ts index 3d207820061..6b76a75b763 100644 --- a/src/vs/editor/contrib/linesOperations/copyLinesCommand.ts +++ b/src/vs/editor/contrib/linesOperations/copyLinesCommand.ts @@ -5,10 +5,10 @@ import { Range } from 'vs/editor/common/core/range'; import { Selection, SelectionDirection } from 'vs/editor/common/core/selection'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICommand, IEditOperationBuilder, ICursorStateComputerData } from 'vs/editor/common/editorCommon'; import { ITextModel } from 'vs/editor/common/model'; -export class CopyLinesCommand implements editorCommon.ICommand { +export class CopyLinesCommand implements ICommand { private readonly _selection: Selection; private readonly _isCopyingDown: boolean; @@ -27,7 +27,7 @@ export class CopyLinesCommand implements editorCommon.ICommand { this._endLineNumberDelta = 0; } - public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { let s = this._selection; this._startLineNumberDelta = 0; @@ -61,7 +61,7 @@ export class CopyLinesCommand implements editorCommon.ICommand { this._selectionDirection = this._selection.getDirection(); } - public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection { + public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection { let result = helper.getTrackedSelection(this._selectionId!); if (this._startLineNumberDelta !== 0 || this._endLineNumberDelta !== 0) { diff --git a/src/vs/editor/contrib/linesOperations/sortLinesCommand.ts b/src/vs/editor/contrib/linesOperations/sortLinesCommand.ts index a201370cea3..0a1bc6bf90c 100644 --- a/src/vs/editor/contrib/linesOperations/sortLinesCommand.ts +++ b/src/vs/editor/contrib/linesOperations/sortLinesCommand.ts @@ -6,10 +6,10 @@ 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 * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICommand, IEditOperationBuilder, ICursorStateComputerData } from 'vs/editor/common/editorCommon'; import { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model'; -export class SortLinesCommand implements editorCommon.ICommand { +export class SortLinesCommand implements ICommand { private static _COLLATOR: Intl.Collator | null = null; public static getCollator(): Intl.Collator { @@ -29,7 +29,7 @@ export class SortLinesCommand implements editorCommon.ICommand { this.selectionId = null; } - public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void { + public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void { let op = sortLines(model, this.selection, this.descending); if (op) { builder.addEditOperation(op.range, op.text); @@ -38,7 +38,7 @@ export class SortLinesCommand implements editorCommon.ICommand { this.selectionId = builder.trackSelection(this.selection); } - public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection { + public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection { return helper.getTrackedSelection(this.selectionId!); } diff --git a/src/vs/editor/contrib/linesOperations/test/linesOperations.test.ts b/src/vs/editor/contrib/linesOperations/test/linesOperations.test.ts index 58663215088..64b26b23b76 100644 --- a/src/vs/editor/contrib/linesOperations/test/linesOperations.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/linesOperations.test.ts @@ -12,6 +12,19 @@ import { ITextModel } from 'vs/editor/common/model'; import { TitleCaseAction, DeleteAllLeftAction, DeleteAllRightAction, IndentLinesAction, InsertLineAfterAction, InsertLineBeforeAction, JoinLinesAction, LowerCaseAction, SortLinesAscendingAction, SortLinesDescendingAction, TransposeAction, UpperCaseAction, DeleteLinesAction } from 'vs/editor/contrib/linesOperations/linesOperations'; import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; import { createTextModel } from 'vs/editor/test/common/editorTestUtils'; +import type { ICodeEditor } from 'vs/editor/browser/editorBrowser'; +import { EditorAction } from 'vs/editor/browser/editorExtensions'; + +function assertSelection(editor: ICodeEditor, expected: Selection | Selection[]): void { + if (!Array.isArray(expected)) { + expected = [expected]; + } + assert.deepEqual(editor.getSelections(), expected); +} + +function executeAction(action: EditorAction, editor: ICodeEditor): void { + action.run(null!, editor, undefined); +} suite('Editor Contrib - Line Operations', () => { suite('SortLinesAscendingAction', () => { @@ -26,13 +39,13 @@ suite('Editor Contrib - Line Operations', () => { let sortLinesAscendingAction = new SortLinesAscendingAction(); editor.setSelection(new Selection(1, 1, 3, 5)); - sortLinesAscendingAction.run(null!, editor); + executeAction(sortLinesAscendingAction, editor); assert.deepEqual(model.getLinesContent(), [ 'alpha', 'beta', 'omicron' ]); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 1, 3, 7).toString()); + assertSelection(editor, new Selection(1, 1, 3, 7)); }); }); @@ -51,7 +64,7 @@ suite('Editor Contrib - Line Operations', () => { let sortLinesAscendingAction = new SortLinesAscendingAction(); editor.setSelections([new Selection(1, 1, 3, 5), new Selection(5, 1, 7, 5)]); - sortLinesAscendingAction.run(null!, editor); + executeAction(sortLinesAscendingAction, editor); assert.deepEqual(model.getLinesContent(), [ 'alpha', 'beta', @@ -84,13 +97,13 @@ suite('Editor Contrib - Line Operations', () => { let sortLinesDescendingAction = new SortLinesDescendingAction(); editor.setSelection(new Selection(1, 1, 3, 7)); - sortLinesDescendingAction.run(null!, editor); + executeAction(sortLinesDescendingAction, editor); assert.deepEqual(model.getLinesContent(), [ 'omicron', 'beta', 'alpha' ]); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 1, 3, 5).toString()); + assertSelection(editor, new Selection(1, 1, 3, 5)); }); }); @@ -109,7 +122,7 @@ suite('Editor Contrib - Line Operations', () => { let sortLinesDescendingAction = new SortLinesDescendingAction(); editor.setSelections([new Selection(1, 1, 3, 7), new Selection(5, 1, 7, 7)]); - sortLinesDescendingAction.run(null!, editor); + executeAction(sortLinesDescendingAction, editor); assert.deepEqual(model.getLinesContent(), [ 'omicron', 'beta', @@ -143,13 +156,13 @@ suite('Editor Contrib - Line Operations', () => { let deleteAllLeftAction = new DeleteAllLeftAction(); editor.setSelection(new Selection(1, 2, 1, 2)); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'ne', '001'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(1), 'ne'); editor.setSelections([new Selection(2, 2, 2, 2), new Selection(3, 2, 3, 2)]); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(2), 'wo', '002'); - assert.equal(model.getLineContent(3), 'hree', '003'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(2), 'wo'); + assert.equal(model.getLineContent(3), 'hree'); }); }); @@ -164,16 +177,16 @@ suite('Editor Contrib - Line Operations', () => { let deleteAllLeftAction = new DeleteAllLeftAction(); editor.setSelection(new Selection(2, 1, 2, 1)); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'onetwo', '001'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(1), 'onetwo'); editor.setSelections([new Selection(1, 1, 1, 1), new Selection(2, 1, 2, 1)]); - deleteAllLeftAction.run(null!, editor); + executeAction(deleteAllLeftAction, editor); assert.equal(model.getLinesContent()[0], 'onetwothree'); assert.equal(model.getLinesContent().length, 1); editor.setSelection(new Selection(1, 1, 1, 1)); - deleteAllLeftAction.run(null!, editor); + executeAction(deleteAllLeftAction, editor); assert.equal(model.getLinesContent()[0], 'onetwothree'); }); }); @@ -197,7 +210,7 @@ suite('Editor Contrib - Line Operations', () => { editor.setSelections([beforeSecondWasoSelection, endOfBCCSelection, endOfNonono]); - deleteAllLeftAction.run(null!, editor); + executeAction(deleteAllLeftAction, editor); let selections = editor.getSelections()!; assert.equal(model.getLineContent(2), ''); @@ -225,7 +238,7 @@ suite('Editor Contrib - Line Operations', () => { selections[2].endColumn ], [5, 1, 5, 1]); - deleteAllLeftAction.run(null!, editor); + executeAction(deleteAllLeftAction, editor); selections = editor.getSelections()!; assert.equal(model.getLineContent(1), 'hi my name is Carlos Matos waso waso'); @@ -263,24 +276,24 @@ suite('Editor Contrib - Line Operations', () => { let deleteAllLeftAction = new DeleteAllLeftAction(); editor.setSelections([new Selection(1, 2, 1, 2), new Selection(1, 4, 1, 4)]); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'lo', '001'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(1), 'lo'); editor.setSelections([new Selection(2, 2, 2, 2), new Selection(2, 4, 2, 5)]); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(2), 'd', '002'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(2), 'd'); editor.setSelections([new Selection(3, 2, 3, 5), new Selection(3, 7, 3, 7)]); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(3), 'world', '003'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(3), 'world'); editor.setSelections([new Selection(4, 3, 4, 3), new Selection(4, 5, 5, 4)]); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(4), 'jour', '004'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(4), 'jour'); editor.setSelections([new Selection(5, 3, 6, 3), new Selection(6, 5, 7, 5), new Selection(7, 7, 7, 7)]); - deleteAllLeftAction.run(null!, editor); - assert.equal(model.getLineContent(5), 'world', '005'); + executeAction(deleteAllLeftAction, editor); + assert.equal(model.getLineContent(5), 'world'); }); }); @@ -300,7 +313,7 @@ suite('Editor Contrib - Line Operations', () => { assert.equal(model.getLineContent(1), 'Typing some text here on line one'); assert.deepEqual(editor.getSelection(), new Selection(1, 31, 1, 31)); - deleteAllLeftAction.run(null!, editor); + executeAction(deleteAllLeftAction, editor); assert.equal(model.getLineContent(1), 'one'); assert.deepEqual(editor.getSelection(), new Selection(1, 1, 1, 1)); @@ -331,29 +344,29 @@ suite('Editor Contrib - Line Operations', () => { let joinLinesAction = new JoinLinesAction(); editor.setSelection(new Selection(1, 2, 1, 2)); - joinLinesAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'hello world', '001'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 6, 1, 6).toString(), '002'); + executeAction(joinLinesAction, editor); + assert.equal(model.getLineContent(1), 'hello world'); + assertSelection(editor, new Selection(1, 6, 1, 6)); editor.setSelection(new Selection(2, 2, 2, 2)); - joinLinesAction.run(null!, editor); - assert.equal(model.getLineContent(2), 'hello world', '003'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 7, 2, 7).toString(), '004'); + executeAction(joinLinesAction, editor); + assert.equal(model.getLineContent(2), 'hello world'); + assertSelection(editor, new Selection(2, 7, 2, 7)); editor.setSelection(new Selection(3, 2, 3, 2)); - joinLinesAction.run(null!, editor); - assert.equal(model.getLineContent(3), 'hello world', '005'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(3, 7, 3, 7).toString(), '006'); + executeAction(joinLinesAction, editor); + assert.equal(model.getLineContent(3), 'hello world'); + assertSelection(editor, new Selection(3, 7, 3, 7)); editor.setSelection(new Selection(4, 2, 5, 3)); - joinLinesAction.run(null!, editor); - assert.equal(model.getLineContent(4), 'hello world', '007'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(4, 2, 4, 8).toString(), '008'); + executeAction(joinLinesAction, editor); + assert.equal(model.getLineContent(4), 'hello world'); + assertSelection(editor, new Selection(4, 2, 4, 8)); editor.setSelection(new Selection(5, 1, 7, 3)); - joinLinesAction.run(null!, editor); - assert.equal(model.getLineContent(5), 'hello world', '009'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(5, 1, 5, 3).toString(), '010'); + executeAction(joinLinesAction, editor); + assert.equal(model.getLineContent(5), 'hello world'); + assertSelection(editor, new Selection(5, 1, 5, 3)); }); }); @@ -367,10 +380,10 @@ suite('Editor Contrib - Line Operations', () => { let joinLinesAction = new JoinLinesAction(); editor.setSelection(new Selection(2, 1, 2, 1)); - joinLinesAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'hello', '001'); - assert.equal(model.getLineContent(2), 'world', '002'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 6, 2, 6).toString(), '003'); + executeAction(joinLinesAction, editor); + assert.equal(model.getLineContent(1), 'hello'); + assert.equal(model.getLineContent(2), 'world'); + assertSelection(editor, new Selection(2, 6, 2, 6)); }); }); @@ -402,19 +415,16 @@ suite('Editor Contrib - Line Operations', () => { new Selection(10, 1, 10, 1) ]); - joinLinesAction.run(null!, editor); - assert.equal(model.getLinesContent().join('\n'), 'hello world\nhello world\nhello world\nhello world\n\nhello world', '001'); - assert.deepEqual(editor.getSelections()!.toString(), [ + executeAction(joinLinesAction, editor); + assert.equal(model.getLinesContent().join('\n'), 'hello world\nhello world\nhello world\nhello world\n\nhello world'); + assertSelection(editor, [ /** primary cursor */ new Selection(3, 4, 3, 8), new Selection(1, 6, 1, 6), new Selection(2, 2, 2, 8), new Selection(4, 5, 4, 9), new Selection(6, 1, 6, 1) - ].toString(), '002'); - - /** primary cursor */ - assert.deepEqual(editor.getSelection()!.toString(), new Selection(3, 4, 3, 8).toString(), '003'); + ]); }); }); @@ -433,7 +443,7 @@ suite('Editor Contrib - Line Operations', () => { assert.equal(model.getLineContent(1), 'hello my dear'); assert.deepEqual(editor.getSelection(), new Selection(1, 14, 1, 14)); - joinLinesAction.run(null!, editor); + executeAction(joinLinesAction, editor); assert.equal(model.getLineContent(1), 'hello my dear world'); assert.deepEqual(editor.getSelection(), new Selection(1, 14, 1, 14)); @@ -456,29 +466,29 @@ suite('Editor Contrib - Line Operations', () => { let transposeAction = new TransposeAction(); editor.setSelection(new Selection(1, 1, 1, 1)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'hello world', '001'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 2, 1, 2).toString(), '002'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(1), 'hello world'); + assertSelection(editor, new Selection(1, 2, 1, 2)); editor.setSelection(new Selection(1, 6, 1, 6)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'hell oworld', '003'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 7, 1, 7).toString(), '004'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(1), 'hell oworld'); + assertSelection(editor, new Selection(1, 7, 1, 7)); editor.setSelection(new Selection(1, 12, 1, 12)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'hell oworl', '005'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 2, 2, 2).toString(), '006'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(1), 'hell oworl'); + assertSelection(editor, new Selection(2, 2, 2, 2)); editor.setSelection(new Selection(3, 1, 3, 1)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(3), '', '007'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(4, 1, 4, 1).toString(), '008'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(3), ''); + assertSelection(editor, new Selection(4, 1, 4, 1)); editor.setSelection(new Selection(4, 2, 4, 2)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(4), ' ', '009'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(4, 3, 4, 3).toString(), '010'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(4), ' '); + assertSelection(editor, new Selection(4, 3, 4, 3)); } ); @@ -498,24 +508,24 @@ suite('Editor Contrib - Line Operations', () => { let transposeAction = new TransposeAction(); editor.setSelection(new Selection(1, 1, 1, 1)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(2), '', '011'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 1, 2, 1).toString(), '012'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(2), ''); + assertSelection(editor, new Selection(2, 1, 2, 1)); editor.setSelection(new Selection(3, 6, 3, 6)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(4), 'oworld', '013'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(4, 2, 4, 2).toString(), '014'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(4), 'oworld'); + assertSelection(editor, new Selection(4, 2, 4, 2)); editor.setSelection(new Selection(6, 12, 6, 12)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(7), 'd', '015'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(7, 2, 7, 2).toString(), '016'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(7), 'd'); + assertSelection(editor, new Selection(7, 2, 7, 2)); editor.setSelection(new Selection(8, 12, 8, 12)); - transposeAction.run(null!, editor); - assert.equal(model.getLineContent(8), 'hello world', '019'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(8, 12, 8, 12).toString(), '020'); + executeAction(transposeAction, editor); + assert.equal(model.getLineContent(8), 'hello world'); + assertSelection(editor, new Selection(8, 12, 8, 12)); } ); }); @@ -532,44 +542,44 @@ suite('Editor Contrib - Line Operations', () => { let titlecaseAction = new TitleCaseAction(); editor.setSelection(new Selection(1, 1, 1, 12)); - uppercaseAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'HELLO WORLD', '001'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 1, 1, 12).toString(), '002'); + executeAction(uppercaseAction, editor); + assert.equal(model.getLineContent(1), 'HELLO WORLD'); + assertSelection(editor, new Selection(1, 1, 1, 12)); editor.setSelection(new Selection(1, 1, 1, 12)); - lowercaseAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'hello world', '003'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 1, 1, 12).toString(), '004'); + executeAction(lowercaseAction, editor); + assert.equal(model.getLineContent(1), 'hello world'); + assertSelection(editor, new Selection(1, 1, 1, 12)); editor.setSelection(new Selection(1, 3, 1, 3)); - uppercaseAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'HELLO world', '005'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 3, 1, 3).toString(), '006'); + executeAction(uppercaseAction, editor); + assert.equal(model.getLineContent(1), 'HELLO world'); + assertSelection(editor, new Selection(1, 3, 1, 3)); editor.setSelection(new Selection(1, 4, 1, 4)); - lowercaseAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'hello world', '007'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 4, 1, 4).toString(), '008'); + executeAction(lowercaseAction, editor); + assert.equal(model.getLineContent(1), 'hello world'); + assertSelection(editor, new Selection(1, 4, 1, 4)); editor.setSelection(new Selection(1, 1, 1, 12)); - titlecaseAction.run(null!, editor); - assert.equal(model.getLineContent(1), 'Hello World', '009'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 1, 1, 12).toString(), '010'); + executeAction(titlecaseAction, editor); + assert.equal(model.getLineContent(1), 'Hello World'); + assertSelection(editor, new Selection(1, 1, 1, 12)); editor.setSelection(new Selection(2, 1, 2, 6)); - uppercaseAction.run(null!, editor); - assert.equal(model.getLineContent(2), 'ÖÇŞĞÜ', '011'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 1, 2, 6).toString(), '012'); + executeAction(uppercaseAction, editor); + assert.equal(model.getLineContent(2), 'ÖÇŞĞÜ'); + assertSelection(editor, new Selection(2, 1, 2, 6)); editor.setSelection(new Selection(2, 1, 2, 6)); - lowercaseAction.run(null!, editor); - assert.equal(model.getLineContent(2), 'öçşğü', '013'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 1, 2, 6).toString(), '014'); + executeAction(lowercaseAction, editor); + assert.equal(model.getLineContent(2), 'öçşğü'); + assertSelection(editor, new Selection(2, 1, 2, 6)); editor.setSelection(new Selection(2, 1, 2, 6)); - titlecaseAction.run(null!, editor); - assert.equal(model.getLineContent(2), 'Öçşğü', '015'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 1, 2, 6).toString(), '016'); + executeAction(titlecaseAction, editor); + assert.equal(model.getLineContent(2), 'Öçşğü'); + assertSelection(editor, new Selection(2, 1, 2, 6)); } ); @@ -586,27 +596,27 @@ suite('Editor Contrib - Line Operations', () => { let titlecaseAction = new TitleCaseAction(); editor.setSelection(new Selection(1, 1, 1, 12)); - titlecaseAction.run(null!, editor); + executeAction(titlecaseAction, editor); assert.equal(model.getLineContent(1), 'Foo Bar Baz'); editor.setSelection(new Selection(2, 1, 2, 12)); - titlecaseAction.run(null!, editor); + executeAction(titlecaseAction, editor); assert.equal(model.getLineContent(2), 'Foo\'Bar\'Baz'); editor.setSelection(new Selection(3, 1, 3, 12)); - titlecaseAction.run(null!, editor); + executeAction(titlecaseAction, editor); assert.equal(model.getLineContent(3), 'Foo[Bar]Baz'); editor.setSelection(new Selection(4, 1, 4, 12)); - titlecaseAction.run(null!, editor); + executeAction(titlecaseAction, editor); assert.equal(model.getLineContent(4), 'Foo`Bar~Baz'); editor.setSelection(new Selection(5, 1, 5, 12)); - titlecaseAction.run(null!, editor); + executeAction(titlecaseAction, editor); assert.equal(model.getLineContent(5), 'Foo^Bar%Baz'); editor.setSelection(new Selection(6, 1, 6, 12)); - titlecaseAction.run(null!, editor); + executeAction(titlecaseAction, editor); assert.equal(model.getLineContent(6), 'Foo$Bar!Baz'); } ); @@ -621,24 +631,24 @@ suite('Editor Contrib - Line Operations', () => { let lowercaseAction = new LowerCaseAction(); editor.setSelection(new Selection(1, 1, 1, 1)); - uppercaseAction.run(null!, editor); - assert.equal(model.getLineContent(1), '', '013'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 1, 1, 1).toString(), '014'); + executeAction(uppercaseAction, editor); + assert.equal(model.getLineContent(1), ''); + assertSelection(editor, new Selection(1, 1, 1, 1)); editor.setSelection(new Selection(1, 1, 1, 1)); - lowercaseAction.run(null!, editor); - assert.equal(model.getLineContent(1), '', '015'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(1, 1, 1, 1).toString(), '016'); + executeAction(lowercaseAction, editor); + assert.equal(model.getLineContent(1), ''); + assertSelection(editor, new Selection(1, 1, 1, 1)); editor.setSelection(new Selection(2, 2, 2, 2)); - uppercaseAction.run(null!, editor); - assert.equal(model.getLineContent(2), ' ', '017'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 2, 2, 2).toString(), '018'); + executeAction(uppercaseAction, editor); + assert.equal(model.getLineContent(2), ' '); + assertSelection(editor, new Selection(2, 2, 2, 2)); editor.setSelection(new Selection(2, 2, 2, 2)); - lowercaseAction.run(null!, editor); - assert.equal(model.getLineContent(2), ' ', '019'); - assert.deepEqual(editor.getSelection()!.toString(), new Selection(2, 2, 2, 2).toString(), '020'); + executeAction(lowercaseAction, editor); + assert.equal(model.getLineContent(2), ' '); + assertSelection(editor, new Selection(2, 2, 2, 2)); } ); }); @@ -649,17 +659,17 @@ suite('Editor Contrib - Line Operations', () => { const model = editor.getModel()!; const action = new DeleteAllRightAction(); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['']); assert.deepEqual(editor.getSelections(), [new Selection(1, 1, 1, 1)]); editor.setSelection(new Selection(1, 1, 1, 1)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['']); assert.deepEqual(editor.getSelections(), [new Selection(1, 1, 1, 1)]); editor.setSelections([new Selection(1, 1, 1, 1), new Selection(1, 1, 1, 1), new Selection(1, 1, 1, 1)]); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['']); assert.deepEqual(editor.getSelections(), [new Selection(1, 1, 1, 1)]); }); @@ -674,17 +684,17 @@ suite('Editor Contrib - Line Operations', () => { const action = new DeleteAllRightAction(); editor.setSelection(new Selection(1, 2, 1, 5)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['ho', 'world']); assert.deepEqual(editor.getSelections(), [new Selection(1, 2, 1, 2)]); editor.setSelection(new Selection(1, 1, 2, 4)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['ld']); assert.deepEqual(editor.getSelections(), [new Selection(1, 1, 1, 1)]); editor.setSelection(new Selection(1, 1, 1, 3)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['']); assert.deepEqual(editor.getSelections(), [new Selection(1, 1, 1, 1)]); }); @@ -699,12 +709,12 @@ suite('Editor Contrib - Line Operations', () => { const action = new DeleteAllRightAction(); editor.setSelection(new Selection(1, 3, 1, 3)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['he', 'world']); assert.deepEqual(editor.getSelections(), [new Selection(1, 3, 1, 3)]); editor.setSelection(new Selection(2, 1, 2, 1)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['he', '']); assert.deepEqual(editor.getSelections(), [new Selection(2, 1, 2, 1)]); }); @@ -719,17 +729,17 @@ suite('Editor Contrib - Line Operations', () => { const action = new DeleteAllRightAction(); editor.setSelection(new Selection(1, 6, 1, 6)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['helloworld']); assert.deepEqual(editor.getSelections(), [new Selection(1, 6, 1, 6)]); editor.setSelection(new Selection(1, 6, 1, 6)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['hello']); assert.deepEqual(editor.getSelections(), [new Selection(1, 6, 1, 6)]); editor.setSelection(new Selection(1, 6, 1, 6)); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['hello']); assert.deepEqual(editor.getSelections(), [new Selection(1, 6, 1, 6)]); }); @@ -749,34 +759,34 @@ suite('Editor Contrib - Line Operations', () => { new Selection(1, 6, 1, 6), new Selection(3, 4, 3, 4), ]); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['hethere', 'wor']); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3), new Selection(2, 4, 2, 4) ]); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['he', 'wor']); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3), new Selection(2, 4, 2, 4) ]); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['hewor']); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3), new Selection(1, 6, 1, 6) ]); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['he']); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3) ]); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['he']); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3) @@ -798,7 +808,7 @@ suite('Editor Contrib - Line Operations', () => { new Selection(1, 6, 1, 6), new Selection(3, 4, 3, 4), ]); - action.run(null!, editor); + executeAction(action, editor); assert.deepEqual(model.getLinesContent(), ['hethere', 'wor']); assert.deepEqual(editor.getSelections(), [ new Selection(1, 3, 1, 3), @@ -831,7 +841,7 @@ suite('Editor Contrib - Line Operations', () => { editor.setPosition(new Position(lineNumber, column)); let insertLineBeforeAction = new InsertLineBeforeAction(); - insertLineBeforeAction.run(null!, editor); + executeAction(insertLineBeforeAction, editor); callback(editor.getModel()!, cursor); }); } @@ -872,7 +882,7 @@ suite('Editor Contrib - Line Operations', () => { editor.setPosition(new Position(lineNumber, column)); let insertLineAfterAction = new InsertLineAfterAction(); - insertLineAfterAction.run(null!, editor); + executeAction(insertLineAfterAction, editor); callback(editor.getModel()!, cursor); }); } @@ -917,7 +927,7 @@ suite('Editor Contrib - Line Operations', () => { let indentLinesAction = new IndentLinesAction(); editor.setPosition(new Position(1, 2)); - indentLinesAction.run(null!, editor); + executeAction(indentLinesAction, editor); assert.equal(model.getLineContent(1), '\tfunction baz() {'); assert.deepEqual(editor.getSelection(), new Selection(1, 3, 1, 3)); @@ -942,7 +952,7 @@ suite('Editor Contrib - Line Operations', () => { const indentLinesAction = new IndentLinesAction(); editor.setPosition(new Position(1, 1)); - indentLinesAction.run(null!, editor); + executeAction(indentLinesAction, editor); assert.equal(model.getLineContent(1), '\tSome text'); assert.deepEqual(editor.getSelection(), new Selection(1, 2, 1, 2)); }); @@ -964,7 +974,7 @@ suite('Editor Contrib - Line Operations', () => { new Selection(3, 4, 3, 4), ]); const deleteLinesAction = new DeleteLinesAction(); - deleteLinesAction.run(null!, editor); + executeAction(deleteLinesAction, editor); assert.equal(editor.getValue(), 'a\nc'); }); @@ -976,7 +986,7 @@ suite('Editor Contrib - Line Operations', () => { withTestCodeEditor(initialText, {}, (editor) => { editor.setSelections(initialSelections); const deleteLinesAction = new DeleteLinesAction(); - deleteLinesAction.run(null!, editor); + executeAction(deleteLinesAction, editor); assert.equal(editor.getValue(), resultingText.join('\n')); assert.deepEqual(editor.getSelections(), resultingSelections); diff --git a/src/vs/editor/contrib/links/links.ts b/src/vs/editor/contrib/links/links.ts index 6bce7e78d8d..bf5399f274a 100644 --- a/src/vs/editor/contrib/links/links.ts +++ b/src/vs/editor/contrib/links/links.ts @@ -14,7 +14,7 @@ import * as platform from 'vs/base/common/platform'; import { ICodeEditor, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { Position } from 'vs/editor/common/core/position'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { IModelDecorationsChangeAccessor, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/model'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; import { LinkProviderRegistry } from 'vs/editor/common/modes'; @@ -97,7 +97,7 @@ class LinkOccurrence { } } -class LinkDetector implements editorCommon.IEditorContribution { +class LinkDetector implements IEditorContribution { public static readonly ID: string = 'editor.linkDetector'; diff --git a/src/vs/editor/contrib/message/messageController.ts b/src/vs/editor/contrib/message/messageController.ts index badf5eb2d6a..a4fcb5f2d1a 100644 --- a/src/vs/editor/contrib/message/messageController.ts +++ b/src/vs/editor/contrib/message/messageController.ts @@ -10,7 +10,7 @@ import { KeyCode } from 'vs/base/common/keyCodes'; import { IDisposable, Disposable, DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle'; import { alert } from 'vs/base/browser/ui/aria/aria'; import { Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; +import { IEditorContribution, ScrollType } from 'vs/editor/common/editorCommon'; import { registerEditorContribution, EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions'; import { ICodeEditor, IContentWidget, IContentWidgetPosition, ContentWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; @@ -19,7 +19,7 @@ import { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/com import { inputValidationInfoBorder, inputValidationInfoBackground, inputValidationInfoForeground } from 'vs/platform/theme/common/colorRegistry'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -export class MessageController extends Disposable implements editorCommon.IEditorContribution { +export class MessageController extends Disposable implements IEditorContribution { public static readonly ID = 'editor.contrib.messageController'; @@ -144,7 +144,7 @@ class MessageWidget implements IContentWidget { constructor(editor: ICodeEditor, { lineNumber, column }: IPosition, text: string) { this._editor = editor; - this._editor.revealLinesInCenterIfOutsideViewport(lineNumber, lineNumber, editorCommon.ScrollType.Smooth); + this._editor.revealLinesInCenterIfOutsideViewport(lineNumber, lineNumber, ScrollType.Smooth); this._position = { lineNumber, column: column - 1 }; this._domNode = document.createElement('div'); diff --git a/src/vs/editor/contrib/parameterHints/parameterHints.css b/src/vs/editor/contrib/parameterHints/parameterHints.css index b8745f45d72..89bf6462e7f 100644 --- a/src/vs/editor/contrib/parameterHints/parameterHints.css +++ b/src/vs/editor/contrib/parameterHints/parameterHints.css @@ -54,7 +54,7 @@ white-space: initial; } -.monaco-editor .parameter-hints-widget .docs .markdown-docs p code { +.monaco-editor .parameter-hints-widget .docs .markdown-docs code { font-family: var(--monaco-monospace-font); } diff --git a/src/vs/editor/contrib/peekView/peekView.ts b/src/vs/editor/contrib/peekView/peekView.ts index deaf2752ba6..32503e62570 100644 --- a/src/vs/editor/contrib/peekView/peekView.ts +++ b/src/vs/editor/contrib/peekView/peekView.ts @@ -260,7 +260,7 @@ export abstract class PeekViewWidget extends ZoneWidget { export const peekViewTitleBackground = registerColor('peekViewTitle.background', { dark: '#1E1E1E', light: '#FFFFFF', hc: '#0C141F' }, nls.localize('peekViewTitleBackground', 'Background color of the peek view title area.')); export const peekViewTitleForeground = registerColor('peekViewTitleLabel.foreground', { dark: '#FFFFFF', light: '#333333', hc: '#FFFFFF' }, nls.localize('peekViewTitleForeground', 'Color of the peek view title.')); -export const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#6c6c6cb3', hc: '#FFFFFF99' }, nls.localize('peekViewTitleInfoForeground', 'Color of the peek view title info.')); +export const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#616161e6', hc: '#FFFFFF99' }, nls.localize('peekViewTitleInfoForeground', 'Color of the peek view title info.')); export const peekViewBorder = registerColor('peekView.border', { dark: '#007acc', light: '#007acc', hc: contrastBorder }, nls.localize('peekViewBorder', 'Color of the peek view borders and arrow.')); export const peekViewResultsBackground = registerColor('peekViewResult.background', { dark: '#252526', light: '#F3F3F3', hc: Color.black }, nls.localize('peekViewResultsBackground', 'Background color of the peek view result list.')); diff --git a/src/vs/editor/contrib/rename/rename.ts b/src/vs/editor/contrib/rename/rename.ts index 92fccb848b4..e39a0949664 100644 --- a/src/vs/editor/contrib/rename/rename.ts +++ b/src/vs/editor/contrib/rename/rename.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { illegalArgument, onUnexpectedError } from 'vs/base/common/errors'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IEditorProgressService } from 'vs/platform/progress/common/progress'; import { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction, EditorCommand, registerEditorCommand, registerDefaultLanguageCommand } from 'vs/editor/browser/editorExtensions'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; @@ -14,7 +14,6 @@ import { ITextModel } from 'vs/editor/common/model'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { RenameInputField, CONTEXT_RENAME_INPUT_VISIBLE } from './renameInputField'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; import { WorkspaceEdit, RenameProviderRegistry, RenameProvider, RenameLocation, Rejection } from 'vs/editor/common/modes'; import { Position, IPosition } from 'vs/editor/common/core/position'; import { alert } from 'vs/base/browser/ui/aria/aria'; @@ -30,6 +29,11 @@ import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cance import { DisposableStore } from 'vs/base/common/lifecycle'; import { IdleValue, raceCancellation } from 'vs/base/common/async'; import { withNullAsUndefined } from 'vs/base/common/types'; +import { ILogService } from 'vs/platform/log/common/log'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { IConfigurationRegistry, ConfigurationScope, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService'; class RenameSkeleton { @@ -109,13 +113,14 @@ class RenameController implements IEditorContribution { constructor( private readonly editor: ICodeEditor, + @IInstantiationService private readonly _instaService: IInstantiationService, @INotificationService private readonly _notificationService: INotificationService, @IBulkEditService private readonly _bulkEditService: IBulkEditService, @IEditorProgressService private readonly _progressService: IEditorProgressService, - @IContextKeyService private readonly _contextKeyService: IContextKeyService, - @IThemeService private readonly _themeService: IThemeService, + @ILogService private readonly _logService: ILogService, + @ITextResourceConfigurationService private readonly _configService: ITextResourceConfigurationService, ) { - this._renameInputField = this._dispoableStore.add(new IdleValue(() => this._dispoableStore.add(new RenameInputField(this.editor, this._themeService, this._contextKeyService)))); + this._renameInputField = this._dispoableStore.add(new IdleValue(() => this._dispoableStore.add(this._instaService.createInstance(RenameInputField, this.editor, ['acceptRenameInput', 'acceptRenameInputWithPreview'])))); } dispose(): void { @@ -174,11 +179,12 @@ class RenameController implements IEditorContribution { selectionEnd = Math.min(loc.range.endColumn, selection.endColumn) - loc.range.startColumn; } - const newNameOrFocusFlag = await this._renameInputField.getValue().getInput(loc.range, loc.text, selectionStart, selectionEnd); + const supportPreview = this._configService.getValue(this.editor.getModel().uri, 'editor.rename.enablePreview'); + const inputFieldResult = await this._renameInputField.getValue().getInput(loc.range, loc.text, selectionStart, selectionEnd, supportPreview); - - if (typeof newNameOrFocusFlag === 'boolean') { - if (newNameOrFocusFlag) { + // no result, only hint to focus the editor or not + if (typeof inputFieldResult === 'boolean') { + if (inputFieldResult) { this.editor.focus(); } return undefined; @@ -186,7 +192,7 @@ class RenameController implements IEditorContribution { this.editor.focus(); - const renameOperation = raceCancellation(skeleton.provideRenameEdits(newNameOrFocusFlag, 0, [], this._cts.token), this._cts.token).then(async renameResult => { + const renameOperation = raceCancellation(skeleton.provideRenameEdits(inputFieldResult.newName, 0, [], this._cts.token), this._cts.token).then(async renameResult => { if (!renameResult || !this.editor.hasModel()) { return; @@ -197,16 +203,22 @@ class RenameController implements IEditorContribution { return; } - const editResult = await this._bulkEditService.apply(renameResult, { editor: this.editor }); - - // alert - if (editResult.ariaSummary) { - alert(nls.localize('aria', "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc!.text, newNameOrFocusFlag, editResult.ariaSummary)); - } + this._bulkEditService.apply(renameResult, { + editor: this.editor, + showPreview: inputFieldResult.wantsPreview, + label: nls.localize('label', "Renaming '{0}'", loc?.text) + }).then(result => { + if (result.ariaSummary) { + alert(nls.localize('aria', "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc!.text, inputFieldResult.newName, result.ariaSummary)); + } + }).catch(err => { + this._notificationService.error(nls.localize('rename.failedApply', "Rename failed to apply edits")); + this._logService.error(err); + }); }, err => { - this._notificationService.error(nls.localize('rename.failed', "Rename failed to execute.")); - return Promise.reject(err); + this._notificationService.error(nls.localize('rename.failed', "Rename failed to compute edits")); + this._logService.error(err); }); this._progressService.showWhile(renameOperation, 250); @@ -214,8 +226,8 @@ class RenameController implements IEditorContribution { } - acceptRenameInput(): void { - this._renameInputField.getValue().acceptInput(); + acceptRenameInput(wantsPreview: boolean): void { + this._renameInputField.getValue().acceptInput(wantsPreview); } cancelRenameInput(): void { @@ -282,7 +294,7 @@ const RenameCommand = EditorCommand.bindToContribution(RenameC registerEditorCommand(new RenameCommand({ id: 'acceptRenameInput', precondition: CONTEXT_RENAME_INPUT_VISIBLE, - handler: x => x.acceptRenameInput(), + handler: x => x.acceptRenameInput(false), kbOpts: { weight: KeybindingWeight.EditorContrib + 99, kbExpr: EditorContextKeys.focus, @@ -290,6 +302,17 @@ registerEditorCommand(new RenameCommand({ } })); +registerEditorCommand(new RenameCommand({ + id: 'acceptRenameInputWithPreview', + precondition: ContextKeyExpr.and(CONTEXT_RENAME_INPUT_VISIBLE, ContextKeyExpr.has('config.editor.rename.enablePreview')), + handler: x => x.acceptRenameInput(true), + kbOpts: { + weight: KeybindingWeight.EditorContrib + 99, + kbExpr: EditorContextKeys.focus, + primary: KeyMod.Shift + KeyCode.Enter + } +})); + registerEditorCommand(new RenameCommand({ id: 'cancelRenameInput', precondition: CONTEXT_RENAME_INPUT_VISIBLE, @@ -311,3 +334,17 @@ registerDefaultLanguageCommand('_executeDocumentRenameProvider', function (model } return rename(model, position, newName); }); + + +//todo@joh use editor options world +Registry.as(Extensions.Configuration).registerConfiguration({ + id: 'editor', + properties: { + 'editor.rename.enablePreview': { + scope: ConfigurationScope.LANGUAGE_OVERRIDABLE, + description: nls.localize('enablePreview', "Enable/disable the ability to preview changes before renaming"), + default: true, + type: 'boolean' + } + } +}); diff --git a/src/vs/editor/contrib/rename/renameInputField.css b/src/vs/editor/contrib/rename/renameInputField.css index 0478cd7ce48..99757bf38a4 100644 --- a/src/vs/editor/contrib/rename/renameInputField.css +++ b/src/vs/editor/contrib/rename/renameInputField.css @@ -8,6 +8,20 @@ color: inherit; } -.monaco-editor .rename-box .rename-input { - padding: 4px; +.monaco-editor .rename-box.preview { + padding: 3px 3px 0 3px; +} + +.monaco-editor .rename-box .rename-input { + padding: 3px; + width: calc(100% - 6px); +} + +.monaco-editor .rename-box .rename-label { + display: none; + opacity: .8; +} + +.monaco-editor .rename-box.preview .rename-label { + display: inherit; } diff --git a/src/vs/editor/contrib/rename/renameInputField.ts b/src/vs/editor/contrib/rename/renameInputField.ts index 5f36cd8ae21..1a3e60e0071 100644 --- a/src/vs/editor/contrib/rename/renameInputField.ts +++ b/src/vs/editor/contrib/rename/renameInputField.ts @@ -4,166 +4,185 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./renameInputField'; -import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { DisposableStore } from 'vs/base/common/lifecycle'; import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; 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 { localize } from 'vs/nls'; import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { inputBackground, inputBorder, inputForeground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; +import { inputBackground, inputBorder, inputForeground, widgetShadow, editorWidgetBackground } from 'vs/platform/theme/common/colorRegistry'; import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; import { EditorOption } from 'vs/editor/common/config/editorOptions'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { toggleClass } from 'vs/base/browser/dom'; export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey('renameInputVisible', false); -export class RenameInputField implements IContentWidget, IDisposable { +export interface RenameInputFieldResult { + newName: string; + wantsPreview?: boolean; +} + +export class RenameInputField implements IContentWidget { - private _editor: ICodeEditor; private _position?: Position; private _domNode?: HTMLElement; - private _inputField?: HTMLInputElement; + private _input?: HTMLInputElement; + private _label?: HTMLDivElement; private _visible?: boolean; private readonly _visibleContextKey: IContextKey; private readonly _disposables = new DisposableStore(); - // Editor.IContentWidget.allowEditorOverflow - allowEditorOverflow: boolean = true; + readonly allowEditorOverflow: boolean = true; constructor( - editor: ICodeEditor, - private readonly themeService: IThemeService, - contextKeyService: IContextKeyService, + private readonly _editor: ICodeEditor, + private readonly _acceptKeybindings: [string, string], + @IThemeService private readonly _themeService: IThemeService, + @IKeybindingService private readonly _keybindingService: IKeybindingService, + @IContextKeyService contextKeyService: IContextKeyService, ) { this._visibleContextKey = CONTEXT_RENAME_INPUT_VISIBLE.bindTo(contextKeyService); - this._editor = editor; this._editor.addContentWidget(this); - this._disposables.add(editor.onDidChangeConfiguration(e => { + this._disposables.add(this._editor.onDidChangeConfiguration(e => { if (e.hasChanged(EditorOption.fontInfo)) { - this.updateFont(); + this._updateFont(); } })); - this._disposables.add(themeService.onThemeChange(theme => this.onThemeChange(theme))); + this._disposables.add(_themeService.onThemeChange(this._updateStyles, this)); } - private onThemeChange(theme: ITheme): void { - this.updateStyles(theme); - } - - public dispose(): void { + dispose(): void { this._disposables.dispose(); this._editor.removeContentWidget(this); } - public getId(): string { + getId(): string { return '__renameInputWidget'; } - public getDomNode(): HTMLElement { + getDomNode(): HTMLElement { if (!this._domNode) { - this._inputField = document.createElement('input'); - this._inputField.className = 'rename-input'; - this._inputField.type = 'text'; - this._inputField.setAttribute('aria-label', localize('renameAriaLabel', "Rename input. Type new name and press Enter to commit.")); this._domNode = document.createElement('div'); - this._domNode.style.height = `${this._editor.getOption(EditorOption.lineHeight)}px`; this._domNode.className = 'monaco-editor rename-box'; - this._domNode.appendChild(this._inputField); - this.updateFont(); - this.updateStyles(this.themeService.getTheme()); + this._input = document.createElement('input'); + this._input.className = 'rename-input'; + this._input.type = 'text'; + this._input.setAttribute('aria-label', localize('renameAriaLabel', "Rename input. Type new name and press Enter to commit.")); + this._domNode.appendChild(this._input); + + this._label = document.createElement('div'); + this._label.className = 'rename-label'; + this._domNode.appendChild(this._label); + const updateLabel = () => { + const [accept, preview] = this._acceptKeybindings; + this._keybindingService.lookupKeybinding(accept); + this._label!.innerText = localize('label', "{0} to Rename, {1} to Preview", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel()); + }; + updateLabel(); + this._disposables.add(this._keybindingService.onDidUpdateKeybindings(updateLabel)); + + this._updateFont(); + this._updateStyles(this._themeService.getTheme()); } return this._domNode; } - private updateStyles(theme: ITheme): void { - if (!this._inputField) { + private _updateStyles(theme: ITheme): void { + if (!this._input || !this._domNode) { return; } - const background = theme.getColor(inputBackground); - const foreground = theme.getColor(inputForeground); const widgetShadowColor = theme.getColor(widgetShadow); + this._domNode.style.backgroundColor = String(theme.getColor(editorWidgetBackground) ?? ''); + this._domNode.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : ''; + this._domNode.style.color = String(theme.getColor(inputForeground) ?? ''); + + this._input.style.backgroundColor = String(theme.getColor(inputBackground) ?? ''); + // this._input.style.color = String(theme.getColor(inputForeground) ?? ''); const border = theme.getColor(inputBorder); - - this._inputField.style.backgroundColor = background ? background.toString() : ''; - this._inputField.style.color = foreground ? foreground.toString() : ''; - - this._inputField.style.borderWidth = border ? '1px' : '0px'; - this._inputField.style.borderStyle = border ? 'solid' : 'none'; - this._inputField.style.borderColor = border ? border.toString() : 'none'; - - this._domNode!.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : ''; + this._input.style.borderWidth = border ? '1px' : '0px'; + this._input.style.borderStyle = border ? 'solid' : 'none'; + this._input.style.borderColor = border?.toString() ?? 'none'; } - private updateFont(): void { - if (!this._inputField) { + private _updateFont(): void { + if (!this._input || !this._label) { return; } const fontInfo = this._editor.getOption(EditorOption.fontInfo); - this._inputField.style.fontFamily = fontInfo.fontFamily; - this._inputField.style.fontWeight = fontInfo.fontWeight; - this._inputField.style.fontSize = `${fontInfo.fontSize}px`; + this._input.style.fontFamily = fontInfo.fontFamily; + this._input.style.fontWeight = fontInfo.fontWeight; + this._input.style.fontSize = `${fontInfo.fontSize}px`; + + this._label.style.fontSize = `${fontInfo.fontSize * 0.8}px`; } - public getPosition(): IContentWidgetPosition | null { - return this._visible - ? { position: this._position!, preference: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE] } - : null; + getPosition(): IContentWidgetPosition | null { + if (!this._visible) { + return null; + } + return { + position: this._position!, + preference: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE] + }; } - private _currentAcceptInput: (() => void) | null = null; - private _currentCancelInput: ((focusEditor: boolean) => void) | null = null; + private _currentAcceptInput?: (wantsPreview: boolean) => void; + private _currentCancelInput?: (focusEditor: boolean) => void; - public acceptInput(): void { + acceptInput(wantsPreview: boolean): void { if (this._currentAcceptInput) { - this._currentAcceptInput(); + this._currentAcceptInput(wantsPreview); } } - public cancelInput(focusEditor: boolean): void { + cancelInput(focusEditor: boolean): void { if (this._currentCancelInput) { this._currentCancelInput(focusEditor); } } - public getInput(where: IRange, value: string, selectionStart: number, selectionEnd: number): Promise { + getInput(where: IRange, value: string, selectionStart: number, selectionEnd: number, supportPreview: boolean): Promise { + + toggleClass(this._domNode!, 'preview', supportPreview); this._position = new Position(where.startLineNumber, where.startColumn); - this._inputField!.value = value; - this._inputField!.setAttribute('selectionStart', selectionStart.toString()); - this._inputField!.setAttribute('selectionEnd', selectionEnd.toString()); - this._inputField!.size = Math.max((where.endColumn - where.startColumn) * 1.1, 20); + this._input!.value = value; + this._input!.setAttribute('selectionStart', selectionStart.toString()); + this._input!.setAttribute('selectionEnd', selectionEnd.toString()); + this._input!.size = Math.max((where.endColumn - where.startColumn) * 1.1, 20); const disposeOnDone = new DisposableStore(); - const always = () => { - disposeOnDone.dispose(); - this._hide(); - }; - return new Promise(resolve => { + return new Promise(resolve => { this._currentCancelInput = (focusEditor) => { - this._currentAcceptInput = null; - this._currentCancelInput = null; + this._currentAcceptInput = undefined; + this._currentCancelInput = undefined; resolve(focusEditor); return true; }; - this._currentAcceptInput = () => { - if (this._inputField!.value.trim().length === 0 || this._inputField!.value === value) { + this._currentAcceptInput = (wantsPreview) => { + if (this._input!.value.trim().length === 0 || this._input!.value === value) { // empty or whitespace only or not changed this.cancelInput(true); return; } - this._currentAcceptInput = null; - this._currentCancelInput = null; - resolve(this._inputField!.value); + this._currentAcceptInput = undefined; + this._currentCancelInput = undefined; + resolve({ + newName: this._input!.value, + wantsPreview: supportPreview && wantsPreview + }); }; let onCursorChanged = () => { @@ -178,12 +197,9 @@ export class RenameInputField implements IContentWidget, IDisposable { this._show(); - }).then(newValue => { - always(); - return newValue; - }, err => { - always(); - return Promise.reject(err); + }).finally(() => { + disposeOnDone.dispose(); + this._hide(); }); } @@ -194,10 +210,10 @@ export class RenameInputField implements IContentWidget, IDisposable { this._editor.layoutContentWidget(this); setTimeout(() => { - this._inputField!.focus(); - this._inputField!.setSelectionRange( - parseInt(this._inputField!.getAttribute('selectionStart')!), - parseInt(this._inputField!.getAttribute('selectionEnd')!)); + this._input!.focus(); + this._input!.setSelectionRange( + parseInt(this._input!.getAttribute('selectionStart')!), + parseInt(this._input!.getAttribute('selectionEnd')!)); }, 100); } diff --git a/src/vs/editor/contrib/suggest/completionModel.ts b/src/vs/editor/contrib/suggest/completionModel.ts index c1349fa7935..fbc6954b44d 100644 --- a/src/vs/editor/contrib/suggest/completionModel.ts +++ b/src/vs/editor/contrib/suggest/completionModel.ts @@ -192,6 +192,7 @@ export class CompletionModel { } } + const textLabel = typeof item.completion.label === 'string' ? item.completion.label : item.completion.label.name; if (wordPos >= wordLen) { // the wordPos at which scoring starts is the whole word // and therefore the same rules as not having a word apply @@ -206,19 +207,19 @@ export class CompletionModel { if (!match) { continue; // NO match } - if (compareIgnoreCase(item.completion.filterText, item.completion.label) === 0) { + if (compareIgnoreCase(item.completion.filterText, textLabel) === 0) { // filterText and label are actually the same -> use good highlights item.score = match; } else { // re-run the scorer on the label in the hope of a result BUT use the rank // of the filterText-match - item.score = anyScore(word, wordLow, wordPos, item.completion.label, item.labelLow, 0); + item.score = anyScore(word, wordLow, wordPos, textLabel, item.labelLow, 0); item.score[0] = match[0]; // use score from filterText } } else { // by default match `word` against the `label` - let match = scoreFn(word, wordLow, wordPos, item.completion.label, item.labelLow, 0, false); + let match = scoreFn(word, wordLow, wordPos, textLabel, item.labelLow, 0, false); if (!match) { continue; // NO match } diff --git a/src/vs/editor/contrib/suggest/media/suggest.css b/src/vs/editor/contrib/suggest/media/suggest.css index 922fa8cb6e5..20f98ee066c 100644 --- a/src/vs/editor/contrib/suggest/media/suggest.css +++ b/src/vs/editor/contrib/suggest/media/suggest.css @@ -99,20 +99,68 @@ overflow: hidden; text-overflow: ellipsis; white-space: pre; + justify-content: space-between; +} + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left, +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right { + display: flex; } .monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight { font-weight: bold; } -/** Icon styles **/ +/** Status Bar **/ + +.monaco-editor .suggest-widget > .tree { + margin-bottom: 18px; +} +.monaco-editor .suggest-widget > .suggest-status-bar { + visibility: hidden; + + position: absolute; + left: 0; + + box-sizing: border-box; + + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + + width: 100%; + + font-size: 80%; + + border-left-width: 1px; + border-left-style: solid; + border-right-width: 1px; + border-right-style: solid; + border-bottom-width: 1px; + border-bottom-style: solid; + + padding: 1px 8px 1px 4px; + + box-shadow: 0 -.5px 3px #ddd; +} +.monaco-editor .suggest-widget > .suggest-status-bar span { + opacity: 0.7; +} +.monaco-editor .suggest-widget.list-right.docs-side > .suggest-status-bar { + left: auto; + right: 0; +} +.monaco-editor .suggest-widget.docs-side > .suggest-status-bar { + width: 50%; +} + +/** ReadMore Icon styles **/ .monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .codicon-close, -.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore::before { +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .readMore::before { color: inherit; - opacity: 0.6; + opacity: 1; font-size: 14px; - margin-left: 4px; cursor: pointer; } @@ -123,46 +171,117 @@ } .monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .codicon-close:hover, -.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore:hover { +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .readMore:hover { opacity: 1; } +/** signature, qualifier, type/details opacity **/ +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .signature-label, +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .qualifier-label, +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label { + opacity: 0.7; +} + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .qualifier-label { + margin-left: 4px; + opacity: 0.4; + font-size: 90%; + text-overflow: ellipsis; + overflow: hidden; + line-height: 17px; + align-self: center; +} + /** Type Info and icon next to the label in the focused completion item **/ -.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .type-label { +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label { margin-left: 0.8em; - flex: 1; - text-align: right; overflow: hidden; text-overflow: ellipsis; - opacity: 0.7; white-space: nowrap; } -.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .type-label > .monaco-tokenized-source { +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label > .monaco-tokenized-source { display: inline; } -.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore, -.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .type-label, -.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused > .contents > .main > .readMore, -.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused > .contents > .main > .type-label, -.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row.focused > .contents > .main > .readMore { +/** Details: if using CompletionItem#details, show on focus **/ + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .details-label, +.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused > .contents > .main > .right > .details-label { display: none; } -.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused > .contents > .main > .readMore, -.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused > .contents > .main > .type-label { +.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused > .contents > .main > .right > .details-label { display: inline; } +/** Details: if using CompletionItemLabel#details, always show **/ + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right.always-show-details > .details-label, +.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused > .contents > .main > .right.always-show-details > .details-label { + display: inline; +} + +/** Ellipsis on hover **/ +.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row:hover > .contents > .main > .right.can-expand-details > .details-label { + width: calc(100% - 26px); +} + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left { + flex-shrink: 1; + overflow: hidden; +} +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .left > .monaco-icon-label { + flex-shrink: 0; +} +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right { + overflow: hidden; + margin-left: 16px; + flex-shrink: 0; + max-width: 45%; +} + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right > .readMore { + display: inline-block; + position: absolute; + right: 10px; + width: 18px; + height: 18px; + visibility: hidden; +} + +/** Do NOT display ReadMore when docs is side/below **/ +.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row > .contents > .main > .right > .readMore, +.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row > .contents > .main > .right > .readMore { + display: none !important; +} + +/** Do NOT display ReadMore when using plain CompletionItemLabel (details/documentation might not be resolved) **/ +.monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .right:not(.always-show-details) > .readMore { + display: none; +} +/** Focused item can show ReadMore, but can't when docs is side/below **/ +.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused > .contents > .main > .right:not(.always-show-details) > .readMore { + display: inline-block; +} + +.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row > .contents > .main > .right > .readMore, +.monaco-editor .suggest-widget.docs-below .monaco-list .monaco-list-row > .contents > .main > .right > .readMore { + display: none; +} + +.monaco-editor .suggest-widget .monaco-list .monaco-list-row:hover > .contents > .main > .right > .readMore { + visibility: visible; +} + /** Styles for each row in the list **/ .monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated { opacity: 0.66; text-decoration: unset; } -.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated > .monaco-icon-label-description-container { +.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated > .monaco-icon-label-container > .monaco-icon-name-container { text-decoration: line-through; } diff --git a/src/vs/editor/contrib/suggest/media/suggestStatusBar.css b/src/vs/editor/contrib/suggest/media/suggestStatusBar.css new file mode 100644 index 00000000000..cf7b3924f58 --- /dev/null +++ b/src/vs/editor/contrib/suggest/media/suggestStatusBar.css @@ -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. + *--------------------------------------------------------------------------------------------*/ + +.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar { + visibility: visible; +} + +.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar span { + min-height: 18px; +} + +.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row > .contents > .main > .right > .readMore, +.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused > .contents > .main > .right:not(.always-show-details) > .readMore { + display: none; +} + +.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover > .contents > .main > .right.can-expand-details > .details-label { + width: 100%; +} diff --git a/src/vs/editor/contrib/suggest/suggest.ts b/src/vs/editor/contrib/suggest/suggest.ts index d28423e1602..03746920084 100644 --- a/src/vs/editor/contrib/suggest/suggest.ts +++ b/src/vs/editor/contrib/suggest/suggest.ts @@ -30,12 +30,16 @@ export class CompletionItem { _brand!: 'ISuggestionItem'; readonly resolve: (token: CancellationToken) => Promise; + isResolved: boolean = false; // readonly editStart: IPosition; readonly editInsertEnd: IPosition; readonly editReplaceEnd: IPosition; + // + readonly textLabel: string; + // perf readonly labelLow: string; readonly sortTextLow?: string; @@ -54,8 +58,13 @@ export class CompletionItem { readonly provider: modes.CompletionItemProvider, model: ITextModel ) { + this.textLabel = typeof completion.label === 'string' + ? completion.label + : completion.label.name; + // ensure lower-variants (perf) - this.labelLow = completion.label.toLowerCase(); + this.labelLow = this.textLabel.toLowerCase(); + this.sortTextLow = completion.sortText && completion.sortText.toLowerCase(); this.filterTextLow = completion.filterText && completion.filterText.toLowerCase(); @@ -74,14 +83,14 @@ export class CompletionItem { const { resolveCompletionItem } = provider; if (typeof resolveCompletionItem !== 'function') { this.resolve = () => Promise.resolve(); + this.isResolved = true; } else { let cached: Promise | undefined; this.resolve = (token) => { if (!cached) { - let isDone = false; cached = Promise.resolve(resolveCompletionItem.call(provider, model, position, completion, token)).then(value => { assign(completion, value); - isDone = true; + this.isResolved = true; }, err => { if (isPromiseCanceledError(err)) { // the IPC queue will reject the request with the @@ -90,7 +99,7 @@ export class CompletionItem { } }); token.onCancellationRequested(() => { - if (!isDone) { + if (!this.isResolved) { // cancellation after the request has been // dispatched -> reset cache cached = undefined; @@ -183,7 +192,7 @@ export function provideSuggestionItems( } // fill in default sortText when missing if (!suggestion.sortText) { - suggestion.sortText = suggestion.label; + suggestion.sortText = typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.name; } allSuggestions.push(new CompletionItem(position, suggestion, container, provider, model)); diff --git a/src/vs/editor/contrib/suggest/suggestController.ts b/src/vs/editor/contrib/suggest/suggestController.ts index cdf2e4f41ef..f54f304688c 100644 --- a/src/vs/editor/contrib/suggest/suggestController.ts +++ b/src/vs/editor/contrib/suggest/suggestController.ts @@ -43,7 +43,7 @@ import { SuggestRangeHighlighter } from 'vs/editor/contrib/suggest/suggestRangeH * Stop suggest widget from disappearing when clicking into other areas * For development purpose only */ -const _sticky = false; +const _sticky = true; class LineSuffix { @@ -165,7 +165,20 @@ export class SuggestController implements IEditorContribution { })); this._toDispose.add(toDisposable(() => makesTextEdit.reset())); + this._toDispose.add(widget.onDetailsKeyDown(e => { + // cmd + c on macOS, ctrl + c on Win / Linux + if ( + e.toKeybinding().equals(new SimpleKeybinding(true, false, false, false, KeyCode.KEY_C)) || + (platform.isMacintosh && e.toKeybinding().equals(new SimpleKeybinding(false, false, false, true, KeyCode.KEY_C))) + ) { + e.stopPropagation(); + return; + } + if (!e.toKeybinding().isModifierKey()) { + this.editor.focus(); + } + })); return widget; })); @@ -198,21 +211,6 @@ export class SuggestController implements IEditorContribution { } })); - this._toDispose.add(this.widget.getValue().onDetailsKeyDown(e => { - // cmd + c on macOS, ctrl + c on Win / Linux - if ( - e.toKeybinding().equals(new SimpleKeybinding(true, false, false, false, KeyCode.KEY_C)) || - (platform.isMacintosh && e.toKeybinding().equals(new SimpleKeybinding(false, false, false, true, KeyCode.KEY_C))) - ) { - e.stopPropagation(); - return; - } - - if (!e.toKeybinding().isModifierKey()) { - this.editor.focus(); - } - })); - // Manage the acceptSuggestionsOnEnter context key let acceptSuggestionsOnEnter = SuggestContext.AcceptSuggestionsOnEnter.bindTo(_contextKeyService); let updateFromConfig = () => { @@ -343,8 +341,9 @@ export class SuggestController implements IEditorContribution { } private _alertCompletionItem({ completion: suggestion }: CompletionItem): void { + const textLabel = typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.name; if (isNonEmptyArray(suggestion.additionalTextEdits)) { - let msg = nls.localize('arai.alert.snippet', "Accepting '{0}' made {1} additional edits", suggestion.label, suggestion.additionalTextEdits.length); + let msg = nls.localize('arai.alert.snippet', "Accepting '{0}' made {1} additional edits", textLabel, suggestion.additionalTextEdits.length); alert(msg); } } @@ -529,11 +528,8 @@ const SuggestCommand = EditorCommand.bindToContribution(Sugge registerEditorCommand(new SuggestCommand({ id: 'acceptSelectedSuggestion', precondition: SuggestContext.Visible, - handler(x, args) { - const alternative: boolean = typeof args === 'object' && typeof args.alternative === 'boolean' - ? args.alternative - : false; - x.acceptSelectedSuggestion(true, alternative); + handler(x) { + x.acceptSelectedSuggestion(true, false); } })); @@ -553,16 +549,23 @@ KeybindingsRegistry.registerKeybindingRule({ weight }); +// todo@joh control enablement via context key // shift+enter and shift+tab use the alternative-flag so that the suggest controller // is doing the opposite of the editor.suggest.overwriteOnAccept-configuration -KeybindingsRegistry.registerKeybindingRule({ - id: 'acceptSelectedSuggestion', - when: ContextKeyExpr.and(SuggestContext.Visible, EditorContextKeys.textInputFocus), - primary: KeyMod.Shift | KeyCode.Tab, - secondary: [KeyMod.Shift | KeyCode.Enter], - args: { alternative: true }, - weight -}); +registerEditorCommand(new SuggestCommand({ + id: 'acceptAlternativeSelectedSuggestion', + precondition: ContextKeyExpr.and(SuggestContext.Visible, EditorContextKeys.textInputFocus), + kbOpts: { + weight: weight, + kbExpr: EditorContextKeys.textInputFocus, + primary: KeyMod.Shift | KeyCode.Enter, + secondary: [KeyMod.Shift | KeyCode.Tab], + }, + handler(x) { + x.acceptSelectedSuggestion(false, true); + }, +})); + // continue to support the old command CommandsRegistry.registerCommandAlias('acceptSelectedSuggestionOnEnter', 'acceptSelectedSuggestion'); diff --git a/src/vs/editor/contrib/suggest/suggestModel.ts b/src/vs/editor/contrib/suggest/suggestModel.ts index 8b54a83d451..f4607a3b65c 100644 --- a/src/vs/editor/contrib/suggest/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/suggestModel.ts @@ -142,10 +142,10 @@ export class SuggestModel implements IDisposable { })); let editorIsComposing = false; - this._toDispose.add(this._editor.onCompositionStart(() => { + this._toDispose.add(this._editor.onDidCompositionStart(() => { editorIsComposing = true; })); - this._toDispose.add(this._editor.onCompositionEnd(() => { + this._toDispose.add(this._editor.onDidCompositionEnd(() => { // refilter when composition ends editorIsComposing = false; this._refilterCompletionItems(); @@ -233,7 +233,7 @@ export class SuggestModel implements IDisposable { }; this._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter)); - this._triggerCharacterListener.add(this._editor.onCompositionEnd(checkTriggerCharacter)); + this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(checkTriggerCharacter)); } // --- trigger/retrigger/cancel suggest @@ -286,9 +286,7 @@ export class SuggestModel implements IDisposable { ) { // Early exit if nothing needs to be done! // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) - if (this._state !== State.Idle) { - this.cancel(); - } + this.cancel(); return; } diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index 85358ea708f..95c1a8c24f9 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./media/suggest'; +import 'vs/css!./media/suggestStatusBar'; import 'vs/base/browser/ui/codiconLabel/codiconLabel'; // The codicon symbol styles are defined here and must be loaded import 'vs/editor/contrib/documentSymbols/outlineTree'; // The codicon symbol colors are defined here and must be loaded import * as nls from 'vs/nls'; @@ -22,7 +23,6 @@ import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition, IEditorMouseEvent } from 'vs/editor/browser/editorBrowser'; import { Context as SuggestContext, CompletionItem } from './suggest'; import { CompletionModel } from './completionModel'; -import { alert } from 'vs/base/browser/ui/aria/aria'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IThemeService, ITheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; @@ -42,16 +42,31 @@ import { FileKind } from 'vs/platform/files/common/files'; import { MarkdownString } from 'vs/base/common/htmlContent'; import { flatten } from 'vs/base/common/arrays'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { Position } from 'vs/editor/common/core/position'; const expandSuggestionDocsByDefault = false; interface ISuggestionTemplateData { root: HTMLElement; + + /** + * Flexbox + * < ------- left ------- > < -------- right -------- > + *